Skip to content

Commit

Permalink
fix swapped testing.expect error message
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal committed Feb 13, 2023
1 parent e99bec0 commit 4c4a122
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/testing/expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ function notPass(message: string): Result {
expect.extend({
toIncludes(received: string, substring: string): Result {
return received.includes(substring)
? pass(`expected '${received}' to be includes ${substring}`)
: notPass(`expected '${received}' not to be includes ${substring}`);
? pass(`expected '${received}' not to includes '${substring}'`)
: notPass(`expected '${received}' to includes '${substring}'`);
},
toBeEmpty(received: string | Array<unknown>): Result {
return received.length > 0
? notPass(`expected not to be empty`)
: pass(`expected to be empty, got length ${received.length}`);
? notPass(`expected to be empty, got length ${received.length}`)
: pass(`expected not to be empty`);
},
toBeExist(received: string): Result {
return fs.existsSync(received)
? pass(`expected path '${received}' to be exist`)
: notPass(`expected path '${received}' not to be exist`);
? pass(`expected path '${received}' not to be exist`)
: notPass(`expected path '${received}' to be exist`);
},
});

Expand Down

0 comments on commit 4c4a122

Please sign in to comment.