installed pty
[VSoRC/.git] / node_modules / node-pty / lib / testUtils.test.js
1 "use strict";
2 /**
3  * Copyright (c) 2019, Microsoft Corporation (MIT License).
4  */
5 Object.defineProperty(exports, "__esModule", { value: true });
6 function pollUntil(cb, timeout, interval) {
7     return new Promise(function (resolve, reject) {
8         var intervalId = setInterval(function () {
9             if (cb()) {
10                 clearInterval(intervalId);
11                 clearTimeout(timeoutId);
12                 resolve();
13             }
14         }, interval);
15         var timeoutId = setTimeout(function () {
16             clearInterval(intervalId);
17             if (cb()) {
18                 resolve();
19             }
20             else {
21                 reject();
22             }
23         }, timeout);
24     });
25 }
26 exports.pollUntil = pollUntil;
27 //# sourceMappingURL=testUtils.test.js.map