Additional tests
This commit is contained in:
@ -4,6 +4,11 @@ const {once} = require('./_30s.js');
|
||||
test('once is a Function', () => {
|
||||
expect(once).toBeInstanceOf(Function);
|
||||
});
|
||||
test('once is a Function', () => {
|
||||
test('once returns Function', () => {
|
||||
expect(typeof once(x => 10)).toBe('function');
|
||||
});
|
||||
test('once returns the result only once', () => {
|
||||
let onced = once(x => x);
|
||||
expect(onced(10)).toBe(10);
|
||||
expect(onced(10)).toBe(undefined);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user