mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-30 21:41:46 +01:00
Tweaks to test running
This commit is contained in:
@@ -58,4 +58,19 @@ export function disposeAll(disposables: vscode.Disposable[]) {
|
||||
item.dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function conditionalTest(name: string, testCallback: (done: MochaDone) => void | Thenable<any>) {
|
||||
if (isTestTypeActive()) {
|
||||
const async = !!testCallback.length;
|
||||
if (async) {
|
||||
test(name, (done) => testCallback(done));
|
||||
} else {
|
||||
test(name, () => (<() => void | Thenable<any>>testCallback)());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isTestTypeActive(): boolean {
|
||||
return !!vscode.extensions.getExtension('vscode-resolver-test');
|
||||
}
|
||||
Reference in New Issue
Block a user