Skip to content

Commit

Permalink
tests: update test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Dec 13, 2020
1 parent 813269a commit a55426c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,23 @@ const cliPath = `${__dirname}/fixtures/cli.js`;

describe("cli-prompts-test", () => {
it("picks a single option", async () => {
const { stdout, exitCode } = await runTest(
const { exitCode, stdout } = await runTest(
[cliPath],
[`${DOWN}${DOWN}${SPACE}${ENTER}`]
);

// Assertions
expect(exitCode).toBe(0);
expect(stdout).toContain("You chose blue");
});

it("picks multiple options", async () => {
const { stdout, exitCode } = await runTest(
const { exitCode, stdout } = await runTest(
[cliPath],
[`${SPACE}${DOWN}${DOWN}${DOWN}${SPACE}${ENTER}${DOWN}${SPACE}${ENTER}`]
);

// Assertions
expect(exitCode).toBe(0);
expect(stdout).toContain("You chose aqua, fuchsia, green");
});
Expand Down

0 comments on commit a55426c

Please sign in to comment.