Skip to content

Commit 47385f8

Browse files
authored
Don't transpile async/await in tests (#27029)
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 47385f8

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"@babel/plugin-syntax-jsx": "^7.10.4",
1919
"@babel/plugin-syntax-typescript": "^7.14.5",
2020
"@babel/plugin-transform-arrow-functions": "^7.10.4",
21-
"@babel/plugin-transform-async-to-generator": "^7.10.4",
2221
"@babel/plugin-transform-block-scoped-functions": "^7.10.4",
2322
"@babel/plugin-transform-block-scoping": "^7.11.1",
2423
"@babel/plugin-transform-classes": "^7.10.4",

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)