mediawiki-extensions-Popups/tests/node-qunit/wait.test.js
Jon Robson 7ff66a50b0 Fixes flakey test: it should resolve after waiting
Change-Id: I6d63fa2d316af296401eaa3dabee10375e73108b
2023-05-09 10:43:56 -07:00

11 lines
294 B
JavaScript

import wait from '../../src/wait';
QUnit.module( 'ext.popups/wait' );
QUnit.test( 'it should resolve after waiting', function ( assert ) {
const then = Date.now();
return wait( 150 ).then( () => {
assert.true( ( Date.now() - then ) >= 150, 'It waits for the given duration' );
} );
} );