Skip to content

Commit

Permalink
test(utils): adds tests for isPromist
Browse files Browse the repository at this point in the history
  • Loading branch information
rafamel committed Oct 2, 2019
1 parent c52e6e4 commit 4e05218
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/utils/is-promist.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import isPromist from '~/utils/is-promist';
import { mark } from '~/helpers';

test(`returns false`, () => {
for (const kind of mark.list) {
expect(isPromist(Promise.resolve(), kind)).toBe(false);
}
});
test(`returns true`, () => {
for (const kind of mark.list) {
const promise = mark.set(Promise.resolve(), kind);
expect(isPromist(promise, kind)).toBe(true);
for (const inner of mark.list) {
if (kind === inner) continue;
expect(isPromist(promise, inner)).toBe(false);
}
}
});

0 comments on commit 4e05218

Please sign in to comment.