Skip to content

Commit

Permalink
chore: upgrade the tests for ts-node error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
alanquigley-toast committed Apr 22, 2022
1 parent ef45fc3 commit 5e4d4fb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/loader.spec.ts
Expand Up @@ -54,10 +54,16 @@ describe("TypeScriptLoader", () => {
let stub: jest.SpyInstance<tsnode.Service, [service: tsnode.Service]>;

beforeEach(() => {
stub = jest.spyOn(tsnode, "register").mockImplementation(() => {
// eslint-disable-next-line @typescript-eslint/no-throw-literal
throw unknownError;
});
stub = jest.spyOn(tsnode, "register").mockImplementation(
() =>
({
compile: (): string => {
// eslint-disable-next-line @typescript-eslint/no-throw-literal
throw unknownError;
},
} as any)
);
loader = TypeScriptLoader();
});

afterEach(() => {
Expand Down

0 comments on commit 5e4d4fb

Please sign in to comment.