mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-22 09:26:51 +00:00
build: migrate build system to Vite and test runner to Vitest & Remove
depracated husky usage - Replace Webpack with Vite for faster client bundling and HMR. - Migrate tests from Jest to Vitest and update configuration. - Update Web Worker instantiation to standard ESM syntax. - Implement Env utility in `src/core` for safe, hybrid environment variable access (Vite vs Node). - Refactor configuration loaders to remove direct `process.env` dependencies in shared code. - Update TypeScript environment definitions and project scripts for the new toolchain. - Remove the [depracated usage of the husky](https://github.com/typicode/husky/releases/tag/v9.0.1). build(vite): implement robust git commit resolution with fallback
This commit is contained in:
@@ -112,7 +112,7 @@ describe("DeleteUnitExecution Security Tests", () => {
|
||||
});
|
||||
|
||||
it("should prevent deleting units during spawn phase", () => {
|
||||
jest.spyOn(game, "inSpawnPhase").mockReturnValue(true);
|
||||
vi.spyOn(game, "inSpawnPhase").mockReturnValue(true);
|
||||
|
||||
const execution = new DeleteUnitExecution(player, unit.id());
|
||||
execution.init(game, 0);
|
||||
@@ -122,7 +122,7 @@ describe("DeleteUnitExecution Security Tests", () => {
|
||||
});
|
||||
|
||||
it("should allow deleting units when all conditions are met", () => {
|
||||
jest.spyOn(game, "inSpawnPhase").mockReturnValue(false);
|
||||
vi.spyOn(game, "inSpawnPhase").mockReturnValue(false);
|
||||
|
||||
const execution = new DeleteUnitExecution(player, unit.id());
|
||||
execution.init(game, 0);
|
||||
@@ -131,7 +131,7 @@ describe("DeleteUnitExecution Security Tests", () => {
|
||||
});
|
||||
|
||||
it("should delete after deletion delay", () => {
|
||||
jest.spyOn(game, "inSpawnPhase").mockReturnValue(false);
|
||||
vi.spyOn(game, "inSpawnPhase").mockReturnValue(false);
|
||||
|
||||
const execution = new DeleteUnitExecution(player, unit.id());
|
||||
game.addExecution(execution);
|
||||
@@ -144,7 +144,7 @@ describe("DeleteUnitExecution Security Tests", () => {
|
||||
});
|
||||
|
||||
it("should reset deletion if captured", () => {
|
||||
jest.spyOn(game, "inSpawnPhase").mockReturnValue(false);
|
||||
vi.spyOn(game, "inSpawnPhase").mockReturnValue(false);
|
||||
|
||||
const execution = new DeleteUnitExecution(player, unit.id());
|
||||
game.addExecution(execution);
|
||||
|
||||
Reference in New Issue
Block a user