-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove pollUntil, add unit test debug target
- Loading branch information
Showing
6 changed files
with
79 additions
and
802 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,37 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "attach", | ||
"name": "Attach to process ID", | ||
"processId": "${command:PickProcess}" | ||
} | ||
] | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Unit Tests", | ||
"cwd": "${workspaceRoot}", | ||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/mocha", | ||
"windows": { | ||
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/mocha.cmd" | ||
}, | ||
"runtimeArgs": [ | ||
"--colors", | ||
"--recursive", | ||
"${workspaceRoot}/lib/**/*.test.js" | ||
], | ||
"env": { | ||
"NODE_PATH": "${workspaceRoot}/lib" | ||
}, | ||
"sourceMaps": true, | ||
"outFiles": [ | ||
"${workspaceRoot}/lib/**/*.js" | ||
], | ||
"internalConsoleOptions": "openOnSessionStart" | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "attach", | ||
"name": "Attach to process ID", | ||
"processId": "${command:PickProcess}" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* Copyright (c) 2019, Microsoft Corporation (MIT License). | ||
*/ | ||
|
||
export function pollUntil(cb: () => boolean, timeout: number, interval: number): Promise<void> { | ||
return new Promise<void>((resolve, reject) => { | ||
const intervalId = setInterval(() => { | ||
if (cb()) { | ||
clearInterval(intervalId); | ||
clearTimeout(timeoutId); | ||
resolve(); | ||
} | ||
}, interval); | ||
const timeoutId = setTimeout(() => { | ||
clearInterval(intervalId); | ||
if (cb()) { | ||
resolve(); | ||
} else { | ||
reject(); | ||
} | ||
}, timeout); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.