mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-23 07:03:54 -07:00
migrate from CRA to vite
This commit is contained in:
parent
98ce317ee1
commit
68e22d22bf
56 changed files with 5699 additions and 28288 deletions
|
|
@ -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()', () => {
|
||||
|
|
|
|||
|
|
@ -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 });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue