Skip to content

Commit

Permalink
Refactor ConsoleThread class instantiation and add singleton pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
drazisil committed Sep 19, 2024
1 parent c334eb6 commit 6a6809f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cli/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ describe("ConsoleThread", () => {
trace: () => vi.fn(),
fatal: () => vi.fn(),
} as any;
new ConsoleThread({ parentThread, log });
const instance = new ConsoleThread({ parentThread, log });
expect(instance).toBeInstanceOf(ConsoleThread);
expect(() => new ConsoleThread({ parentThread, log })).toThrow(
"ConsoleThread already exists",
);
Expand Down

0 comments on commit 6a6809f

Please sign in to comment.