mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
fix unit tests and refactor types
This commit is contained in:
parent
decebc25c7
commit
fea21b5057
75 changed files with 908 additions and 501 deletions
|
|
@ -1,20 +1,6 @@
|
|||
vi.mock('../../WebClient', () => ({
|
||||
WebClient: {
|
||||
instance: {
|
||||
protobuf: { sendRoomCommand: vi.fn() },
|
||||
response: {
|
||||
room: {
|
||||
gameCreated: vi.fn(),
|
||||
joinedGame: vi.fn(),
|
||||
leaveRoom: vi.fn(),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}));
|
||||
vi.mock('../../WebClient');
|
||||
|
||||
import { makeCallbackHelpers } from '../../__mocks__/callbackHelpers';
|
||||
import { useWebClientCleanup } from '../../__mocks__/helpers';
|
||||
import { WebClient } from '../../WebClient';
|
||||
import {
|
||||
Command_CreateGame_ext,
|
||||
|
|
@ -32,8 +18,6 @@ import { roomSay } from './roomSay';
|
|||
import { create } from '@bufbuild/protobuf';
|
||||
import { Mock } from 'vitest';
|
||||
|
||||
useWebClientCleanup();
|
||||
|
||||
const { invokeOnSuccess } = makeCallbackHelpers(
|
||||
WebClient.instance.protobuf.sendRoomCommand as Mock,
|
||||
// sendRoomCommand(roomId, ext, value, options) — options at index 3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue