Skip to content

Commit

Permalink
chore: use jest-serializer-raw for react-fresh snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jun 3, 2019
1 parent a383c46 commit 576ad53
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 77 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"packages/*"
],
"devDependencies": {
"@mattiasbuelens/web-streams-polyfill": "0.1.0",
"art": "^0.10.1",
"babel-cli": "^6.6.5",
"babel-code-frame": "^6.26.0",
Expand Down Expand Up @@ -62,6 +63,7 @@
"jasmine-check": "^1.0.0-rc.0",
"jest": "^23.1.0",
"jest-diff": "^23.0.1",
"jest-snapshot-serializer-raw": "^1.1.0",
"minimatch": "^3.0.4",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
Expand All @@ -83,8 +85,7 @@
"targz": "^1.0.1",
"through2": "^2.0.0",
"tmp": "~0.0.28",
"typescript": "~1.8.10",
"@mattiasbuelens/web-streams-polyfill": "0.1.0"
"typescript": "~1.8.10"
},
"devEngines": {
"node": "8.x || 9.x || 10.x || 11.x || 12.x"
Expand Down
11 changes: 7 additions & 4 deletions packages/react-fresh/src/__tests__/ReactFreshBabelPlugin-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,15 @@

let babel = require('babel-core');
let freshPlugin = require('react-fresh/babel');
let {wrap} = require('jest-snapshot-serializer-raw');

function transform(input, options = {}) {
return babel.transform(input, {
babelrc: false,
plugins: ['syntax-jsx', freshPlugin],
}).code;
return wrap(
babel.transform(input, {
babelrc: false,
plugins: ['syntax-jsx', freshPlugin],
}).code,
);
}

describe('ReactFreshBabelPlugin', () => {
Expand Down
Loading

0 comments on commit 576ad53

Please sign in to comment.