Throw error instead of using fail method

This commit is contained in:
Robert
2023-06-21 16:02:57 +01:00
parent 0451dd8d1b
commit 0031c1acc0
3 changed files with 3 additions and 7 deletions

View File

@@ -49,7 +49,7 @@ describe("commands declared in package.json", () => {
expect(title).toBeDefined();
commandTitles[command] = title!;
} else {
fail(`Unexpected command name ${command}`);
throw new Error(`Unexpected command name ${command}`);
}
});

View File

@@ -13,7 +13,7 @@ describe("helpers-pure", () => {
try {
await asyncFilter([1, 2, 3], rejects);
fail("Should have thrown");
throw new Error("Should have thrown");
} catch (e) {
expect(getErrorMessage(e)).toBe("opps");
}

View File

@@ -310,11 +310,7 @@ export class DebugController
*/
private async nextEvent(): Promise<AnyDebugEvent> {
if (this.resolver !== undefined) {
const error = new Error(
"Attempt to wait for multiple debugger events at once.",
);
fail(error);
throw error;
throw new Error("Attempt to wait for multiple debugger events at once.");
} else {
if (this.nextEventIndex < this.eventQueue.length) {
// No need to wait.