Throw error instead of using fail method
This commit is contained in:
@@ -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}`);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user