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,16 +1,16 @@
jest.mock('websocket', () => ({
vi.mock('websocket', () => ({
AdminCommands: {
adjustMod: jest.fn(),
reloadConfig: jest.fn(),
shutdownServer: jest.fn(),
updateServerMessage: jest.fn(),
adjustMod: vi.fn(),
reloadConfig: vi.fn(),
shutdownServer: vi.fn(),
updateServerMessage: vi.fn(),
},
}));
import { AdminService } from './AdminService';
import { AdminCommands } from 'websocket';
beforeEach(() => jest.clearAllMocks());
beforeEach(() => vi.clearAllMocks());
describe('AdminService', () => {
describe('adjustMod', () => {

View file

@ -1,14 +1,14 @@
jest.mock('websocket', () => ({
vi.mock('websocket', () => ({
SessionCommands: {
connect: jest.fn(),
disconnect: jest.fn(),
connect: vi.fn(),
disconnect: vi.fn(),
},
webClient: {
connectionAttemptMade: false,
},
}));
jest.mock('websocket/services/ProtoController', () => ({
vi.mock('websocket/services/ProtoController', () => ({
ProtoController: {
root: {
ServerInfo_User: {
@ -26,7 +26,7 @@ import { StatusEnum, WebSocketConnectOptions, WebSocketConnectReason } from 'typ
const testOptions: WebSocketConnectOptions = { host: 'localhost', port: '4748', userName: 'user', password: 'pw' };
beforeEach(() => jest.clearAllMocks());
beforeEach(() => vi.clearAllMocks());
describe('AuthenticationService', () => {
describe('login', () => {

View file

@ -1,11 +1,11 @@
jest.mock('websocket', () => ({
vi.mock('websocket', () => ({
ModeratorCommands: {
banFromServer: jest.fn(),
getBanHistory: jest.fn(),
getWarnHistory: jest.fn(),
getWarnList: jest.fn(),
viewLogHistory: jest.fn(),
warnUser: jest.fn(),
banFromServer: vi.fn(),
getBanHistory: vi.fn(),
getWarnHistory: vi.fn(),
getWarnList: vi.fn(),
viewLogHistory: vi.fn(),
warnUser: vi.fn(),
},
}));
@ -13,7 +13,7 @@ import { ModeratorService } from './ModeratorService';
import { ModeratorCommands } from 'websocket';
import { LogFilters } from 'types';
beforeEach(() => jest.clearAllMocks());
beforeEach(() => vi.clearAllMocks());
describe('ModeratorService', () => {
describe('banFromServer', () => {

View file

@ -1,17 +1,17 @@
jest.mock('websocket', () => ({
vi.mock('websocket', () => ({
SessionCommands: {
joinRoom: jest.fn(),
joinRoom: vi.fn(),
},
RoomCommands: {
leaveRoom: jest.fn(),
roomSay: jest.fn(),
leaveRoom: vi.fn(),
roomSay: vi.fn(),
},
}));
import { RoomsService } from './RoomsService';
import { RoomCommands, SessionCommands } from 'websocket';
beforeEach(() => jest.clearAllMocks());
beforeEach(() => vi.clearAllMocks());
describe('RoomsService', () => {
describe('joinRoom', () => {

View file

@ -1,22 +1,22 @@
jest.mock('websocket', () => ({
vi.mock('websocket', () => ({
SessionCommands: {
addToBuddyList: jest.fn(),
removeFromBuddyList: jest.fn(),
addToIgnoreList: jest.fn(),
removeFromIgnoreList: jest.fn(),
accountPassword: jest.fn(),
accountEdit: jest.fn(),
accountImage: jest.fn(),
message: jest.fn(),
getUserInfo: jest.fn(),
getGamesOfUser: jest.fn(),
addToBuddyList: vi.fn(),
removeFromBuddyList: vi.fn(),
addToIgnoreList: vi.fn(),
removeFromIgnoreList: vi.fn(),
accountPassword: vi.fn(),
accountEdit: vi.fn(),
accountImage: vi.fn(),
message: vi.fn(),
getUserInfo: vi.fn(),
getGamesOfUser: vi.fn(),
},
}));
import { SessionService } from './SessionService';
import { SessionCommands } from 'websocket';
beforeEach(() => jest.clearAllMocks());
beforeEach(() => vi.clearAllMocks());
describe('SessionService', () => {
describe('addToBuddyList', () => {