Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
Haroenv committed Sep 20, 2017
1 parent 1cd2751 commit 72be344
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,18 @@ test(`throws the error if tested function didn't throw error`, () => {
}
});

test('does not accept arguments', () => {
const filename = 'does-not-accept-arguments.test.js';
const template = makeTemplate(`test('does not accept arguments', () => {
expect(() => { throw new Error('apple'); })
.toThrowErrorMatchingSnapshot('foobar');
test('accepts custom snapshot name', () => {
const filename = 'accept-custom-snapshot-name.test.js';
const template = makeTemplate(`test('accepts custom snapshot name', () => {
expect(true).toThrowErrorMatchingSnapshot('custom-name');
});
`);

{
writeFiles(TESTS_DIR, {[filename]: template()});
const {stderr, status} = runJest(DIR, ['-w=1', '--ci=false', filename]);
expect(stderr).toMatch('Matcher does not accept any arguments.');
expect(status).toBe(1);
expect(stderr).toMatch('1 snapshot written in 1 test suite.');
expect(status).toBe(0);
}
});

Expand Down

0 comments on commit 72be344

Please sign in to comment.