Skip to content

Commit 8a6db44

Browse files
committed
Use snapshots for records tests
1 parent 3605035 commit 8a6db44

File tree

2 files changed

+31
-26
lines changed

2 files changed

+31
-26
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`ConfigTestCases records issue-2991 exported tests should write relative paths to records 1`] = `
4+
"{
5+
\\"modules\\": {
6+
\\"byIdentifier\\": {
7+
\\"external \\\\\\"path\\\\\\"\\": 0,
8+
\\"external \\\\\\"fs\\\\\\"\\": 1,
9+
\\"ignored pkgs/somepackage/foo\\": 2,
10+
\\"test.js\\": 3
11+
},
12+
\\"usedIds\\": {
13+
\\"0\\": 0,
14+
\\"1\\": 1,
15+
\\"2\\": 2,
16+
\\"3\\": 3
17+
}
18+
},
19+
\\"chunks\\": {
20+
\\"byName\\": {
21+
\\"main\\": 0
22+
},
23+
\\"bySource\\": {},
24+
\\"usedIds\\": [
25+
0
26+
]
27+
}
28+
}"
29+
`;
Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,10 @@
11
try {
22
require("pkgs/somepackage/foo");
3-
} catch(e){}
3+
} catch (e) {}
44

55
it("should write relative paths to records", function() {
66
var fs = require("fs");
77
var path = require("path");
88
var content = fs.readFileSync(path.join(__dirname, "records.json"), "utf-8");
9-
expect(content).toEqual(`{
10-
"modules": {
11-
"byIdentifier": {
12-
"external \\"path\\"": 0,
13-
"external \\"fs\\"": 1,
14-
"ignored pkgs/somepackage/foo": 2,
15-
"test.js": 3
16-
},
17-
"usedIds": {
18-
"0": 0,
19-
"1": 1,
20-
"2": 2,
21-
"3": 3
22-
}
23-
},
24-
"chunks": {
25-
"byName": {
26-
"main": 0
27-
},
28-
"bySource": {},
29-
"usedIds": [
30-
0
31-
]
32-
}
33-
}`);
9+
expect(content).toMatchSnapshot();
3410
});

0 commit comments

Comments
 (0)