Skip to content

Commit 3277d41

Browse files
hemal7735evenstensberg
authored andcommitted
tests(mode): use extractSummary
1 parent 0ba72c4 commit 3277d41

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
"use strict";
22

3-
const { run } = require("../../../testUtils");
3+
const { run, extractSummary } = require("../../../testUtils");
44

55
test("none", () => {
66
const { code, stdout, stderr } = run(__dirname, ["./index.js", "--mode", "none"]);
7+
78
expect(code).toBe(0);
8-
expect(stdout).toEqual(expect.anything());
9-
expect(stdout).toContain("main.js");
10-
expect(stdout).toMatch(/index\.js.*\{0\}/);
9+
10+
const summary = extractSummary(stdout);
11+
12+
expect(summary).toEqual(expect.anything());
13+
expect(summary).toContain("main.js");
14+
expect(summary).toMatch(/index\.js.*\{0\}/);
1115
expect(stderr).toHaveLength(0);
12-
expect(stdout).toMatchSnapshot();
16+
expect(summary).toMatchSnapshot();
1317
});

0 commit comments

Comments
 (0)