Skip to content

Commit ed36260

Browse files
hemal7735evenstensberg
authored andcommitted
tests(config-type): use extractSummary
1 parent 3e30a57 commit ed36260

File tree

5 files changed

+33
-23
lines changed

5 files changed

+33
-23
lines changed
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"usr strict";
22

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

55
test("array", () => {
66
const { code, stdout, stderr } = run(__dirname, [
@@ -12,12 +12,14 @@ test("array", () => {
1212
"production"
1313
]);
1414

15+
const summary = extractSummary(stdout);
16+
1517
expect(code).toBe(0);
16-
expect(stdout).toEqual(expect.anything());
17-
expect(stdout).toContain("Child");
18-
expect(stdout).toContain("entry-a.bundle.js");
19-
expect(stdout).toContain("Child");
20-
expect(stdout).toContain("entry-b.bundle.js");
18+
expect(summary).toEqual(expect.anything());
19+
expect(summary).toContain("Child");
20+
expect(summary).toContain("entry-a.bundle.js");
21+
expect(summary).toContain("Child");
22+
expect(summary).toContain("entry-b.bundle.js");
2123
expect(stderr).toHaveLength(0);
22-
expect(stdout).toMatchSnapshot();
24+
expect(summary).toMatchSnapshot();
2325
});
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

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

55
test("function-promise", () => {
66
const { code, stdout, stderr } = run(__dirname, [
@@ -12,9 +12,11 @@ test("function-promise", () => {
1212
"production"
1313
]);
1414

15+
const summary = extractSummary(stdout);
16+
1517
expect(code).toBe(0);
16-
expect(stdout).toEqual(expect.anything());
17-
expect(stdout).toContain("entry.bundle.js");
18+
expect(summary).toEqual(expect.anything());
19+
expect(summary).toContain("entry.bundle.js");
1820
expect(stderr).toHaveLength(0);
19-
expect(stdout).toMatchSnapshot();
21+
expect(summary).toMatchSnapshot();
2022
});
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

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

55
test("function", () => {
66
const { code, stdout, stderr } = run(__dirname, [
@@ -12,9 +12,11 @@ test("function", () => {
1212
"production"
1313
]);
1414

15+
const summary = extractSummary(stdout);
16+
1517
expect(code).toBe(0);
16-
expect(stdout).toEqual(expect.anything());
17-
expect(stdout).toContain("entry.bundle.js");
18+
expect(summary).toEqual(expect.anything());
19+
expect(summary).toContain("entry.bundle.js");
1820
expect(stderr).toHaveLength(0);
19-
expect(stdout).toMatchSnapshot();
21+
expect(summary).toMatchSnapshot();
2022
});
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

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

55
test("object", () => {
66
const { code, stdout, stderr } = run(__dirname, [
@@ -12,9 +12,11 @@ test("object", () => {
1212
"production"
1313
]);
1414

15+
const summary = extractSummary(stdout);
16+
1517
expect(code).toBe(0);
16-
expect(stdout).toEqual(expect.anything());
17-
expect(stdout).toContain("entry.bundle.js");
18+
expect(summary).toEqual(expect.anything());
19+
expect(summary).toContain("entry.bundle.js");
1820
expect(stderr).toHaveLength(0);
19-
expect(stdout).toMatchSnapshot();
21+
expect(summary).toMatchSnapshot();
2022
});
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use strict";
22

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

55
test("promise", () => {
66
const { code, stdout, stderr } = run(__dirname, [
@@ -12,9 +12,11 @@ test("promise", () => {
1212
"production"
1313
]);
1414

15+
const summary = extractSummary(stdout);
16+
1517
expect(code).toBe(0);
16-
expect(stdout).toEqual(expect.anything());
17-
expect(stdout).toContain("entry.bundle.js");
18+
expect(summary).toEqual(expect.anything());
19+
expect(summary).toContain("entry.bundle.js");
1820
expect(stderr).toHaveLength(0);
19-
expect(stdout).toMatchSnapshot();
21+
expect(summary).toMatchSnapshot();
2022
});

0 commit comments

Comments
 (0)