Skip to content

Commit

Permalink
Condense fail into one file
Browse files Browse the repository at this point in the history
  • Loading branch information
mattphillips committed Jan 29, 2022
1 parent 8246b83 commit 1f703d1
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 24 deletions.
9 changes: 9 additions & 0 deletions src/matchers/fail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export function fail(_, message) {
return {
pass: false,
message: () => {
if (message) return () => message;
else return () => 'fails by .fail() assertion';
},
};
}
5 changes: 0 additions & 5 deletions src/matchers/fail/__snapshots__/index.test.js.snap

This file was deleted.

10 changes: 0 additions & 10 deletions src/matchers/fail/index.js

This file was deleted.

1 change: 0 additions & 1 deletion src/matchers/fail/predicate.js

This file was deleted.

7 changes: 0 additions & 7 deletions src/matchers/fail/predicate.test.js

This file was deleted.

5 changes: 5 additions & 0 deletions test/matchers/__snapshots__/fail.test.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`.fail fails with message 1`] = `"() => message"`;

exports[`.fail fails without message 1`] = `"() => 'fails by .fail() assertion'"`;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as matcher from './';
import * as matcher from 'src/matchers/fail';

expect.extend(matcher);

Expand Down

0 comments on commit 1f703d1

Please sign in to comment.