Skip to content

Commit 5e7136d

Browse files
committed
Don't transpile async/await in tests
Modern runtimes support native async/await, as does the version of Node we use for our tests. To match how most of our users run React, this disables the transpilation of async/await in our test suite.
1 parent 1fdacbe commit 5e7136d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

scripts/jest/preprocessor.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ const pathToBabel = path.join(
1717
const pathToBabelPluginReplaceConsoleCalls = require.resolve(
1818
'../babel/transform-replace-console-calls'
1919
);
20-
const pathToBabelPluginAsyncToGenerator = require.resolve(
21-
'@babel/plugin-transform-async-to-generator'
22-
);
2320
const pathToTransformInfiniteLoops = require.resolve(
2421
'../babel/transform-prevent-infinite-loops'
2522
);
@@ -78,7 +75,7 @@ module.exports = {
7875
const isInDevToolsPackages = !!filePath.match(
7976
/\/packages\/react-devtools.*\//
8077
);
81-
const testOnlyPlugins = [pathToBabelPluginAsyncToGenerator];
78+
const testOnlyPlugins = [];
8279
const sourceOnlyPlugins = [];
8380
if (process.env.NODE_ENV === 'development' && !isInDevToolsPackages) {
8481
sourceOnlyPlugins.push(pathToBabelPluginReplaceConsoleCalls);

0 commit comments

Comments
 (0)