UNPKG

waait

Version:

A little function to wait

18 lines (15 loc) 321 B
const wait = require('./'); const test = require('tape'); test('should be promise', t => { t.plan(1); t.equal(typeof wait().then, 'function'); }); test('should wait', t => { t.plan(1); const track = []; wait(10).then(_ => { track.push('b'); t.deepEqual(['a', 'b'], track); }) track.push('a'); });