mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 09:38:38 +01:00
@@ -18,6 +18,25 @@ export function itRepeat(n: number, description: string, callback: (this: Contex
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines a test-case that will run but will be skips it if it throws an exception. This is useful
|
||||
* to get some runs in CI when trying to stabilize a flaky test, without failing the build. Note
|
||||
* that this only works if something inside the test throws, so a test's overall timeout won't work
|
||||
* but throwing due to a polling timeout will.
|
||||
* @param title The test-case title.
|
||||
* @param callback The test-case callback.
|
||||
*/
|
||||
export function itSkipOnFail(title: string, callback: (this: Context) => any): void {
|
||||
it(title, function () {
|
||||
return Promise.resolve().then(() => {
|
||||
return callback.apply(this, arguments);
|
||||
}).catch(() => {
|
||||
console.warn(`Test "${title}" failed but was marks as skip on fail`);
|
||||
this.skip();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function installAllHandlers(logger: Logger, optionsTransform?: (opts: ApplicationOptions) => ApplicationOptions) {
|
||||
installDiagnosticsHandler(logger);
|
||||
installAppBeforeHandler(optionsTransform);
|
||||
|
||||
Reference in New Issue
Block a user