Skip to content

Commit

Permalink
tests(config-file): use extractSummary
Browse files Browse the repository at this point in the history
  • Loading branch information
hemal7735 committed Jan 21, 2019
1 parent 0817c50 commit b1abc3d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
@@ -1,6 +1,6 @@
"use strict";

const { run } = require("../../../testUtils");
const { run, extractSummary } = require("../../../testUtils");

test("plugins-precedence", () => {
const { code, stdout, stderr } = run(__dirname, [
Expand All @@ -18,9 +18,11 @@ test("plugins-precedence", () => {
"TEST=\"ok\""
]);

const summary = extractSummary(stdout);

expect(code).toBe(0);
expect(stdout).toEqual(expect.anything());
expect(stdout).toContain("ok.js");
expect(summary).toEqual(expect.anything());
expect(summary).toContain("ok.js");
expect(stderr).toHaveLength(0);
expect(stdout).toMatchSnapshot();
expect(summary).toMatchSnapshot();
});
8 changes: 5 additions & 3 deletions test/binCases/configFile/profile/profile.test.js
@@ -1,12 +1,14 @@
"use strict";

const { run } = require("../../../testUtils");
const { run, extractSummary } = require("../../../testUtils");

test("profile", () => {
const { code, stdout, stderr } = run(__dirname, []);

const summary = extractSummary(stdout);

expect(code).toBe(0);
expect(stdout).toEqual(expect.anything());
expect(stdout).toContain("factory:");
expect(summary).toEqual(expect.anything());
expect(summary).toContain("factory:");
expect(stderr).toHaveLength(0);
});

0 comments on commit b1abc3d

Please sign in to comment.