mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-15 03:32:15 +01:00
add timesheet unit and e2e tests; add unit test CI setup
This commit is contained in:
20
resources/js/test-setup.ts
Normal file
20
resources/js/test-setup.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
// Vitest setup file. Wires up the globals that the production code reads
|
||||
// off `window` (`getTimezoneSetting`, `getWeekStartSetting`, `getNumberFormat`,
|
||||
// `getIntervalFormat`) so that helpers under test don't crash when imported
|
||||
// outside the running app.
|
||||
|
||||
import { vi } from 'vitest';
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
getTimezoneSetting: () => string;
|
||||
getWeekStartSetting: () => string;
|
||||
getNumberFormat: () => string;
|
||||
getIntervalFormat: () => string;
|
||||
}
|
||||
}
|
||||
|
||||
window.getTimezoneSetting = vi.fn(() => 'UTC');
|
||||
window.getWeekStartSetting = vi.fn(() => 'monday');
|
||||
window.getNumberFormat = vi.fn(() => 'point');
|
||||
window.getIntervalFormat = vi.fn(() => 'hours-minutes');
|
||||
Reference in New Issue
Block a user