migrate from CRA to vite

This commit is contained in:
seavor 2026-04-12 18:35:13 -05:00
parent 98ce317ee1
commit 68e22d22bf
56 changed files with 5699 additions and 28288 deletions

View file

@ -1,4 +1,4 @@
jest.mock('store/store', () => ({ store: { dispatch: jest.fn() } }));
vi.mock('store/store', () => ({ store: { dispatch: vi.fn() } }));
import { store } from 'store/store';
import { Actions } from './game.actions';
@ -11,7 +11,7 @@ import {
makePlayerProperties,
} from './__mocks__/fixtures';
beforeEach(() => jest.clearAllMocks());
beforeEach(() => vi.clearAllMocks());
describe('Dispatch', () => {
it('clearStore dispatches Actions.clearStore()', () => {

View file

@ -890,14 +890,14 @@ describe('2J: Turn, phase, and chat', () => {
it('GAME_SAY → appends message with mocked Date.now() as timeReceived', () => {
const state = makeState();
jest.spyOn(Date, 'now').mockReturnValue(123456789);
vi.spyOn(Date, 'now').mockReturnValue(123456789);
const result = gamesReducer(state, {
type: Types.GAME_SAY,
gameId: 1,
playerId: 2,
message: 'gg',
});
jest.restoreAllMocks();
vi.restoreAllMocks();
expect(result.games[1].messages).toHaveLength(1);
expect(result.games[1].messages[0]).toEqual({ playerId: 2, message: 'gg', timeReceived: 123456789 });