test: add src/renderer.test.ts
This commit is contained in:
parent
4f43106ed4
commit
fb1b8c4c96
|
|
@ -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',
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue