Skip to content

Commit

Permalink
Fix tests again
Browse files Browse the repository at this point in the history
  • Loading branch information
TrySound committed Aug 30, 2018
1 parent 9ade87d commit 55c4d6f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 deletions.
42 changes: 18 additions & 24 deletions test/__snapshots__/test.js.snap
@@ -1,30 +1,24 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`works with code splitting 1`] = `
Array [
Array [
"chunk-1.js",
Object {
"code": "var chunk1=\\"chunk-1\\";console.log(chunk1);
Object {
"chunk-1.js": Object {
"code": "var chunk1=\\"chunk-1\\";console.log(chunk1);
",
"exports": Array [],
"fileName": "chunk-1.js",
"imports": Array [],
"isEntry": true,
"map": null,
},
],
Array [
"chunk-2.js",
Object {
"code": "var chunk2=\\"chunk-2\\";console.log(chunk2);
"exports": Array [],
"fileName": "chunk-1.js",
"imports": Array [],
"isEntry": true,
"map": null,
},
"chunk-2.js": Object {
"code": "var chunk2=\\"chunk-2\\";console.log(chunk2);
",
"exports": Array [],
"fileName": "chunk-2.js",
"imports": Array [],
"isEntry": true,
"map": null,
},
],
]
"exports": Array [],
"fileName": "chunk-2.js",
"imports": Array [],
"isEntry": true,
"map": null,
},
}
`;
9 changes: 6 additions & 3 deletions test/test.js
Expand Up @@ -74,7 +74,10 @@ test("works with code splitting", async () => {
plugins: [uglify()]
});
const { output } = await bundle.generate({ format: "esm" });
expect(
Object.entries(output).map(([key, { modules, ...value }]) => [key, value])
).toMatchSnapshot();
const newOutput = {};
Object.keys(output).forEach(key => {
const { modules, ...value } = output[key];
newOutput[key] = value;
});
expect(newOutput).toMatchSnapshot();
});

0 comments on commit 55c4d6f

Please sign in to comment.