mirror of https://github.com/msgbyte/tailchat
test: add is-promise testcase and fix test problem
parent
6e65712de6
commit
edaaf220b4
@ -0,0 +1 @@
|
||||
declare module 'str2int';
|
@ -0,0 +1,16 @@
|
||||
import { isPromise } from '../is-promise';
|
||||
|
||||
describe('isPromise', () => {
|
||||
test.each([
|
||||
[Promise.resolve(), true],
|
||||
['str', false],
|
||||
[123, false],
|
||||
[[], false],
|
||||
[{}, false],
|
||||
[Symbol('sym'), false],
|
||||
[undefined, false],
|
||||
[null, false],
|
||||
])('%s => %s', (input, should) => {
|
||||
expect(isPromise(input)).toBe(should);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue