Skip to content

Commit aaee515

Browse files
1 parent 8a42a2a commit aaee515

3 files changed

Lines changed: 29 additions & 7 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2+
3+
exports[`ConfigCacheTestCases asset-modules minimize-fragment-names minimize-fragment-names should compile 1`] = `"export const answer=function(){return 3};"`;
4+
5+
exports[`ConfigCacheTestCases asset-modules minimize-fragment-names minimize-fragment-names should compile 2`] = `"export const answer=function(){return 3};"`;
6+
7+
exports[`ConfigCacheTestCases asset-modules minimize-fragment-names minimize-fragment-names should compile 3`] = `".fragment{color:red}"`;
8+
9+
exports[`ConfigCacheTestCases asset-modules minimize-fragment-names minimize-fragment-names should compile 4`] = `
10+
"<!doctype html><head><title>Fragment</title></head><body><p class=a>hi</p>
11+
12+
</body></html>"
13+
`;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
2+
3+
exports[`ConfigTestCases asset-modules minimize-fragment-names minimize-fragment-names should compile 1`] = `"export const answer=function(){return 3};"`;
4+
5+
exports[`ConfigTestCases asset-modules minimize-fragment-names minimize-fragment-names should compile 2`] = `"export const answer=function(){return 3};"`;
6+
7+
exports[`ConfigTestCases asset-modules minimize-fragment-names minimize-fragment-names should compile 3`] = `".fragment{color:red}"`;
8+
9+
exports[`ConfigTestCases asset-modules minimize-fragment-names minimize-fragment-names should compile 4`] = `
10+
"<!doctype html><head><title>Fragment</title></head><body><p class=a>hi</p>
11+
12+
</body></html>"
13+
`;

‎test/configCases/asset-modules/minimize-fragment-names/test.config.js‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,14 @@ module.exports = {
1515
// Named `bundle<index>.js#<contenthash>` by `output.filename`.
1616
expect(read(`bundle${index}.js`)).not.toContain("webpackBootstrap");
1717
// Named `<index>/script.js#frag` by `assetModuleFilename`.
18-
expect(read(`${index}/script.js`)).toBe(
19-
"export const answer=function(){return 3};"
20-
);
18+
expect(read(`${index}/script.js`)).toMatchSnapshot();
2119
}
2220

2321
// The extension is read before the fragment, so `#a.css` claims nothing.
2422
expect(read("1/data.txt")).toBe("not css {\n");
2523

2624
// Only the second build enables native CSS and HTML.
27-
expect(read("1/style.css")).toBe(".fragment{color:red}");
28-
expect(read("1/page.html")).toBe(
29-
"<!doctype html><head><title>Fragment</title></head><body><p class=a>hi</p>\n\n</body></html>"
30-
);
25+
expect(read("1/style.css")).toMatchSnapshot();
26+
expect(read("1/page.html")).toMatchSnapshot();
3127
}
3228
};

0 commit comments

Comments
 (0)