siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
15 lines (14 loc) • 462 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.delay = function (time, result) {
if (time === void 0) { time = 50; }
return new Promise(function (resolve, reject) {
setTimeout(function () { return resolve(result); }, time);
});
};
exports.timeout = function (time, action) {
var handler = setTimeout(action || function () { }, time);
return function () {
clearTimeout(handler);
};
};
;