updating unit test mock, returning promises in integration test teardowns, not waiting to asynchronously kill chrome on windows
This commit is contained in:
Родитель
6703f2b7d4
Коммит
f3acc91a56
|
@ -39,6 +39,7 @@
|
|||
"--reporter", "node_modules/vscode-chrome-debug-core-testsupport/out/loggingReporter.js",
|
||||
"${workspaceFolder}/out/test/int/*.test.js"
|
||||
],
|
||||
"skipFiles": ["<node_internals>/**"],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
]
|
||||
|
|
|
@ -354,7 +354,7 @@ export class ChromeDebugAdapter extends CoreDebugAdapter {
|
|||
// Only kill Chrome if the 'disconnect' originated from vscode. If we previously terminated
|
||||
// due to Chrome shutting down, or devtools taking over, don't kill Chrome.
|
||||
if (coreUtils.getPlatform() === coreUtils.Platform.Windows && this._chromePID) {
|
||||
await this.killChromeOnWindows(this._chromePID);
|
||||
this.killChromeOnWindows(this._chromePID);
|
||||
} else if (this._chromeProc) {
|
||||
logger.log('Killing Chrome process');
|
||||
this._chromeProc.kill('SIGINT');
|
||||
|
|
|
@ -103,6 +103,10 @@ suite('ChromeDebugAdapter', () => {
|
|||
mockChrome.Runtime
|
||||
.setup(x => x.evaluate(It.isAny()))
|
||||
.returns(() => Promise.resolve<any>({ result: { type: 'string', value: '123' }}));
|
||||
|
||||
mockChrome.Network
|
||||
.setup(x => x.setCacheDisabled(It.isAny()))
|
||||
.returns(() => Promise.resolve());
|
||||
});
|
||||
|
||||
teardown(() => {
|
||||
|
|
|
@ -21,7 +21,7 @@ suite('Chrome Debug Adapter etc', () => {
|
|||
});
|
||||
|
||||
teardown(() => {
|
||||
testSetup.teardown();
|
||||
return testSetup.teardown();
|
||||
});
|
||||
|
||||
suite('basic', () => {
|
||||
|
|
|
@ -25,10 +25,7 @@ function runCommonTests(breakOnLoadStrategy: string) {
|
|||
server.close();
|
||||
}
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
testSetup.teardown();
|
||||
resolve();
|
||||
});
|
||||
return testSetup.teardown();
|
||||
});
|
||||
|
||||
// this function is to help when launching and setting a breakpoint
|
||||
|
@ -253,7 +250,7 @@ suite('BreakOnLoad', () => {
|
|||
server.close();
|
||||
}
|
||||
|
||||
testSetup.teardown();
|
||||
return testSetup.teardown();
|
||||
});
|
||||
|
||||
test('Hits a single breakpoint in a file on load', async () => {
|
||||
|
@ -320,7 +317,7 @@ suite('BreakOnLoad', () => {
|
|||
server.close();
|
||||
}
|
||||
|
||||
testSetup.teardown();
|
||||
return testSetup.teardown();
|
||||
});
|
||||
|
||||
test('Does not hit a breakpoint in a file on load', async () => {
|
||||
|
|
|
@ -25,7 +25,7 @@ suite('Breakpoints', () => {
|
|||
server.close();
|
||||
}
|
||||
|
||||
testSetup.teardown();
|
||||
return testSetup.teardown();
|
||||
});
|
||||
|
||||
suite('Column BPs', () => {
|
||||
|
|
|
@ -25,7 +25,7 @@ suite('Stepping', () => {
|
|||
server.close();
|
||||
}
|
||||
|
||||
testSetup.teardown();
|
||||
return testSetup.teardown();
|
||||
});
|
||||
|
||||
suite('skipFiles', () => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче