Skip to content

Commit

Permalink
test: fix useful but super-annoying eslint error about try catch expects
Browse files Browse the repository at this point in the history
  • Loading branch information
kirbysayshi committed Apr 7, 2020
1 parent 448cc17 commit df2923d
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ try {
}

test('display help via bin', async () => {
let caught;
try {
await execp('./cli --help');
} catch (e) {
expect(e.code).toBe(1);
expect(e.stdout).toMatch(/--age/);
expect(e.stdout).toMatch(/--root/);
expect(e.stdout).toMatch(/--archive/);
expect(e.stdout).toMatch(/--projects/);
expect(e.stdout).toMatch(/--yes/);
caught = e;
}

expect(caught.code).toBe(1);
expect(caught.stdout).toMatch(/--age/);
expect(caught.stdout).toMatch(/--root/);
expect(caught.stdout).toMatch(/--archive/);
expect(caught.stdout).toMatch(/--projects/);
expect(caught.stdout).toMatch(/--yes/);
});

0 comments on commit df2923d

Please sign in to comment.