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 29, 2020
1 parent ee666aa commit 6960265
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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>, {virtual: true});
`,
snapshot: true,
},
'top level mocking': {
code: `
require('x');
Expand Down
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
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 @@ -4818,6 +4818,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 6960265

Please sign in to comment.