X-Git-Url: https://git.josue.xyz/?p=VSoRC%2F.git;a=blobdiff_plain;f=node_modules%2Fnode-pty%2Flib%2FtestUtils.test.js;fp=node_modules%2Fnode-pty%2Flib%2FtestUtils.test.js;h=b861d367a68452072befaed4fd18215db55683e8;hp=0000000000000000000000000000000000000000;hb=e79e4a5a87f3e84f7c1777f10a954453a69bf540;hpb=4339da12467b75fb8b6ca831f4bf0081c485ed2c diff --git a/node_modules/node-pty/lib/testUtils.test.js b/node_modules/node-pty/lib/testUtils.test.js new file mode 100644 index 0000000..b861d36 --- /dev/null +++ b/node_modules/node-pty/lib/testUtils.test.js @@ -0,0 +1,27 @@ +"use strict"; +/** + * Copyright (c) 2019, Microsoft Corporation (MIT License). + */ +Object.defineProperty(exports, "__esModule", { value: true }); +function pollUntil(cb, timeout, interval) { + return new Promise(function (resolve, reject) { + var intervalId = setInterval(function () { + if (cb()) { + clearInterval(intervalId); + clearTimeout(timeoutId); + resolve(); + } + }, interval); + var timeoutId = setTimeout(function () { + clearInterval(intervalId); + if (cb()) { + resolve(); + } + else { + reject(); + } + }, timeout); + }); +} +exports.pollUntil = pollUntil; +//# sourceMappingURL=testUtils.test.js.map \ No newline at end of file