Skip to content

Commit

Permalink
test(jest): add support for vscode mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
char0n committed Oct 14, 2024
1 parent b80d612 commit be0a294
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/react-scripts/config/jest/babelTransform.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports = babelJest.createTransformer({
},
],
],
plugins: ['@babel/plugin-transform-class-static-block'],
babelrc: false,
configFile: false,
});
4 changes: 4 additions & 0 deletions packages/react-scripts/scripts/utils/createJestConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ module.exports = (resolve, rootDir, isEjecting) => {
moduleNameMapper: {
'^react-native$': 'react-native-web',
'^.+\\.module\\.(css|sass|scss)$': 'identity-obj-proxy',
'vscode/vscode/vs/base/common/strings':
'vscode/vscode/src/vs/base/common/strings.js',
'vscode/vscode/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer':
'vscode/vscode/src/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.js',
...(modules.jestAliases || {}),
},
moduleFileExtensions: [...paths.moduleFileExtensions, 'node'].filter(
Expand Down

0 comments on commit be0a294

Please sign in to comment.