test: add src/renderer.test.ts

This commit is contained in:
ToTheos-Dev 2026-05-22 14:25:19 +10:00
parent 4f43106ed4
commit fb1b8c4c96
1 changed files with 24 additions and 0 deletions

24
src/renderer.test.ts Normal file
View File

@ -0,0 +1,24 @@
// @ts-nocheck
jest.mock("./index.css", () => ({}));
const mockConsoleLog = jest.fn();
beforeAll(() => {
jest.spyOn(console, "log").mockImplementation(mockConsoleLog);
});
afterAll(() => {
(console.log as jest.Mock).mockRestore();
});
describe("renderer", () => {
it("should log the expected message and import css without throwing", () => {
expect(() => {
require("./renderer");
}).not.toThrow();
expect(mockConsoleLog).toHaveBeenCalledWith(
'👋 This message is being logged by "renderer.ts", included via Vite',
);
});
});