Skip to content

Commit

Permalink
chore: add failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Oct 31, 2020
1 parent 2b748f6 commit acb43e5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/babel-plugin-jest-hoist/package.json
Expand Up @@ -20,6 +20,7 @@
},
"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/preset-react": "^7.12.1",
"@types/babel__template": "^7.0.2",
"@types/node": "*",
"babel-plugin-tester": "^10.0.0"
Expand Down
14 changes: 14 additions & 0 deletions packages/babel-plugin-jest-hoist/src/__tests__/hoistPlugin.test.ts
Expand Up @@ -13,6 +13,20 @@ pluginTester({
plugin: babelPluginJestHoist,
pluginName: 'babel-plugin-jest-hoist',
tests: {
'automatic react runtime': {
babelOptions: {
presets: [
[
require.resolve('@babel/preset-react'),
{development: true, runtime: 'automatic'},
],
],
},
code: `
jest.mock('./App', () => () => <div>Hello world</div>);
`,
snapshot: true,
},
'top level mocking': {
code: `
require('x');
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Expand Up @@ -1456,7 +1456,7 @@ __metadata:
languageName: node
linkType: hard

"@babel/preset-react@npm:*, @babel/preset-react@npm:^7.0.0, @babel/preset-react@npm:^7.9.4":
"@babel/preset-react@npm:*, @babel/preset-react@npm:^7.0.0, @babel/preset-react@npm:^7.12.1, @babel/preset-react@npm:^7.9.4":
version: 7.12.1
resolution: "@babel/preset-react@npm:7.12.1"
dependencies:
Expand Down Expand Up @@ -4830,6 +4830,7 @@ __metadata:
resolution: "babel-plugin-jest-hoist@workspace:packages/babel-plugin-jest-hoist"
dependencies:
"@babel/core": ^7.11.6
"@babel/preset-react": ^7.12.1
"@babel/template": ^7.3.3
"@babel/types": ^7.3.3
"@types/babel__core": ^7.0.0
Expand Down

0 comments on commit acb43e5

Please sign in to comment.