mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-02-16 17:27:41 +00:00
[Bug] vite port (for development) (#3003)
* make vite-port configurable and make it default 8000 * add retries for `does not trigger by non damage moves` test
This commit is contained in:
parent
8e44ddfde2
commit
589801214b
@ -4,3 +4,4 @@ VITE_SERVER_URL=http://localhost:8001
|
|||||||
VITE_DISCORD_CLIENT_ID=1234567890
|
VITE_DISCORD_CLIENT_ID=1234567890
|
||||||
VITE_GOOGLE_CLIENT_ID=1234567890
|
VITE_GOOGLE_CLIENT_ID=1234567890
|
||||||
VITE_I18N_DEBUG=1
|
VITE_I18N_DEBUG=1
|
||||||
|
VITE_PORT=8000
|
||||||
|
@ -52,7 +52,10 @@ describe("Abilities - Quick Draw", () => {
|
|||||||
expect(pokemon.battleData.abilitiesApplied).contain(Abilities.QUICK_DRAW);
|
expect(pokemon.battleData.abilitiesApplied).contain(Abilities.QUICK_DRAW);
|
||||||
}, 20000);
|
}, 20000);
|
||||||
|
|
||||||
test("does not triggered by non damage moves", async () => {
|
test("does not triggered by non damage moves", {
|
||||||
|
timeout: 20000,
|
||||||
|
retry: 5
|
||||||
|
}, async () => {
|
||||||
await game.startBattle([Species.SLOWBRO]);
|
await game.startBattle([Species.SLOWBRO]);
|
||||||
|
|
||||||
const pokemon = game.scene.getPlayerPokemon();
|
const pokemon = game.scene.getPlayerPokemon();
|
||||||
@ -67,7 +70,8 @@ describe("Abilities - Quick Draw", () => {
|
|||||||
expect(pokemon.isFainted()).toBe(true);
|
expect(pokemon.isFainted()).toBe(true);
|
||||||
expect(enemy.isFainted()).toBe(false);
|
expect(enemy.isFainted()).toBe(false);
|
||||||
expect(pokemon.battleData.abilitiesApplied).not.contain(Abilities.QUICK_DRAW);
|
expect(pokemon.battleData.abilitiesApplied).not.contain(Abilities.QUICK_DRAW);
|
||||||
}, 20000);
|
}
|
||||||
|
);
|
||||||
|
|
||||||
test("does not increase priority", async () => {
|
test("does not increase priority", async () => {
|
||||||
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(Array(4).fill(Moves.EXTREME_SPEED));
|
vi.spyOn(Overrides, "OPP_MOVESET_OVERRIDE", "get").mockReturnValue(Array(4).fill(Moves.EXTREME_SPEED));
|
||||||
|
1
src/vite.env.d.ts
vendored
1
src/vite.env.d.ts
vendored
@ -1,6 +1,7 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
interface ImportMetaEnv {
|
interface ImportMetaEnv {
|
||||||
|
readonly VITE_PORT?: string;
|
||||||
readonly VITE_BYPASS_LOGIN?: string;
|
readonly VITE_BYPASS_LOGIN?: string;
|
||||||
readonly VITE_BYPASS_TUTORIAL?: string;
|
readonly VITE_BYPASS_TUTORIAL?: string;
|
||||||
readonly VITE_API_BASE_URL?: string;
|
readonly VITE_API_BASE_URL?: string;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { defineConfig } from 'vite';
|
import { defineConfig, loadEnv } from 'vite';
|
||||||
import tsconfigPaths from 'vite-tsconfig-paths';
|
import tsconfigPaths from 'vite-tsconfig-paths';
|
||||||
|
|
||||||
export const defaultConfig = {
|
export const defaultConfig = {
|
||||||
@ -20,10 +20,17 @@ export const defaultConfig = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default defineConfig(({mode}) => ({
|
export default defineConfig(({mode}) => {
|
||||||
...defaultConfig,
|
const envPort = Number(loadEnv(mode, process.cwd()).VITE_PORT);
|
||||||
esbuild: {
|
|
||||||
pure: mode === 'production' ? [ 'console.log' ] : [],
|
return ({
|
||||||
keepNames: true,
|
...defaultConfig,
|
||||||
},
|
esbuild: {
|
||||||
}));
|
pure: mode === 'production' ? ['console.log'] : [],
|
||||||
|
keepNames: true,
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
port: !isNaN(envPort) ? envPort : 8000,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user