forked from dotansimha/graphql-code-generator-community
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to latest Jest and faster tests (#6053)
* Faster Unit tests * Fix fake timers * Remove logHeapUsage
- Loading branch information
Showing
13 changed files
with
1,153 additions
and
847 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
diff --git a/node_modules/babel-jest/build/index.js b/node_modules/babel-jest/build/index.js | ||
index f74b673..283655b 100644 | ||
--- a/node_modules/babel-jest/build/index.js | ||
+++ b/node_modules/babel-jest/build/index.js | ||
@@ -208,7 +208,7 @@ function loadBabelOptions( | ||
jestTransformOptions | ||
) { | ||
const {options} = loadBabelConfig(cwd, filename, transformOptions); | ||
- return addIstanbulInstrumentation(options, jestTransformOptions); | ||
+ return addIstanbulInstrumentation(options, transformOptions); | ||
} | ||
|
||
async function loadBabelOptionsAsync( | ||
@@ -218,7 +218,7 @@ async function loadBabelOptionsAsync( | ||
jestTransformOptions | ||
) { | ||
const {options} = await loadBabelConfigAsync(cwd, filename, transformOptions); | ||
- return addIstanbulInstrumentation(options, jestTransformOptions); | ||
+ return addIstanbulInstrumentation(options, transformOptions); | ||
} | ||
|
||
const createTransformer = userOptions => { | ||
@@ -320,11 +320,14 @@ const createTransformer = userOptions => { | ||
); | ||
}, | ||
|
||
- process(sourceText, sourcePath, transformOptions) { | ||
+ process(sourceText, sourcePath, config, transformOptions) { | ||
const babelOptions = loadBabelOptions( | ||
- transformOptions.config.cwd, | ||
+ config.cwd, | ||
sourcePath, | ||
- mergeBabelTransformOptions(sourcePath, transformOptions), | ||
+ mergeBabelTransformOptions(sourcePath, { | ||
+ ...transformOptions, | ||
+ config | ||
+ }), | ||
transformOptions | ||
); | ||
const transformResult = (0, _core().transformSync)( | ||
@@ -381,4 +384,4 @@ const transformer = { | ||
createTransformer | ||
}; | ||
var _default = transformer; | ||
-exports.default = _default; | ||
+module.exports = _default; |
Oops, something went wrong.