mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-18 22:32:32 +02:00
remove all extra vitest workspaces
This commit is contained in:
parent
55dcb70282
commit
f619dbf0d2
26
.github/workflows/run-test-template.yml
vendored
26
.github/workflows/run-test-template.yml
vendored
@ -1,26 +0,0 @@
|
|||||||
name: Test Template
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
project:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
options:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Check out Git repository
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Set up Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 20
|
|
||||||
- name: Install Node.js dependencies
|
|
||||||
run: npm ci
|
|
||||||
- name: Run tests
|
|
||||||
run: npx vitest --project main ${{ inputs.project }} ${{ !runner.debug && '--silent' || '' }}
|
|
@ -1,23 +1,25 @@
|
|||||||
import { defineProject, UserWorkspaceConfig } from 'vitest/config';
|
import { defineProject, UserWorkspaceConfig } from "vitest/config";
|
||||||
import { defaultConfig } from './vite.config';
|
import { defaultConfig } from "./vite.config";
|
||||||
|
|
||||||
export const defaultProjectTestConfig: UserWorkspaceConfig["test"] = {
|
export default defineProject(({ mode }) => ({
|
||||||
setupFiles: ['./src/test/vitest.setup.ts'],
|
...defaultConfig,
|
||||||
|
test: {
|
||||||
|
setupFiles: ["./src/test/vitest.setup.ts"],
|
||||||
server: {
|
server: {
|
||||||
deps: {
|
deps: {
|
||||||
inline: ['vitest-canvas-mock'],
|
inline: ["vitest-canvas-mock"],
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
optimizer: {
|
optimizer: {
|
||||||
web: {
|
web: {
|
||||||
include: ['vitest-canvas-mock'],
|
include: ["vitest-canvas-mock"],
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
environment: 'jsdom' as const,
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
environment: "jsdom" as const,
|
||||||
environmentOptions: {
|
environmentOptions: {
|
||||||
jsdom: {
|
jsdom: {
|
||||||
resources: 'usable',
|
resources: "usable",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
threads: false,
|
threads: false,
|
||||||
@ -25,22 +27,16 @@ export const defaultProjectTestConfig: UserWorkspaceConfig["test"] = {
|
|||||||
restoreMocks: true,
|
restoreMocks: true,
|
||||||
watch: false,
|
watch: false,
|
||||||
coverage: {
|
coverage: {
|
||||||
provider: 'istanbul' as const,
|
provider: "istanbul" as const,
|
||||||
reportsDirectory: 'coverage' as const,
|
reportsDirectory: "coverage" as const,
|
||||||
reporters: ['text-summary', 'html'],
|
reporters: ["text-summary", "html"],
|
||||||
},
|
},
|
||||||
}
|
|
||||||
|
|
||||||
export default defineProject(({ mode }) => ({
|
|
||||||
...defaultConfig,
|
|
||||||
test: {
|
|
||||||
...defaultProjectTestConfig,
|
|
||||||
name: "main",
|
name: "main",
|
||||||
include: ["./src/test/**/*.{test,spec}.ts"],
|
include: ["./src/test/**/*.{test,spec}.ts"],
|
||||||
exclude: ["./src/test/pre.test.ts"],
|
exclude: ["./src/test/pre.test.ts"],
|
||||||
},
|
},
|
||||||
esbuild: {
|
esbuild: {
|
||||||
pure: mode === 'production' ? [ 'console.log' ] : [],
|
pure: mode === "production" ? ["console.log"] : [],
|
||||||
keepNames: true,
|
keepNames: true,
|
||||||
},
|
},
|
||||||
}))
|
}));
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { defineWorkspace } from "vitest/config";
|
import { defineWorkspace } from "vitest/config";
|
||||||
import { defaultConfig } from "./vite.config";
|
import { defaultConfig } from "./vite.config";
|
||||||
import { defaultProjectTestConfig } from "./vitest.config";
|
|
||||||
|
|
||||||
export default defineWorkspace([
|
export default defineWorkspace([
|
||||||
{
|
{
|
||||||
@ -11,58 +10,5 @@ export default defineWorkspace([
|
|||||||
environment: "jsdom",
|
environment: "jsdom",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
...defaultConfig,
|
|
||||||
test: {
|
|
||||||
...defaultProjectTestConfig,
|
|
||||||
name: "misc",
|
|
||||||
include: [
|
|
||||||
"src/test/achievements/**/*.{test,spec}.ts",
|
|
||||||
"src/test/arena/**/*.{test,spec}.ts",
|
|
||||||
"src/test/battlerTags/**/*.{test,spec}.ts",
|
|
||||||
"src/test/eggs/**/*.{test,spec}.ts",
|
|
||||||
"src/test/field/**/*.{test,spec}.ts",
|
|
||||||
"src/test/inputs/**/*.{test,spec}.ts",
|
|
||||||
"src/test/localization/**/*.{test,spec}.ts",
|
|
||||||
"src/test/phases/**/*.{test,spec}.ts",
|
|
||||||
"src/test/settingMenu/**/*.{test,spec}.ts",
|
|
||||||
"src/test/sprites/**/*.{test,spec}.ts",
|
|
||||||
"src/test/ui/**/*.{test,spec}.ts",
|
|
||||||
"src/test/*.{test,spec}.ts",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
...defaultConfig,
|
|
||||||
test: {
|
|
||||||
...defaultProjectTestConfig,
|
|
||||||
name: "abilities",
|
|
||||||
include: ["src/test/abilities/**/*.{test,spec}.ts"],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
...defaultConfig,
|
|
||||||
test: {
|
|
||||||
...defaultProjectTestConfig,
|
|
||||||
name: "battle",
|
|
||||||
include: ["src/test/battle/**/*.{test,spec}.ts"],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
...defaultConfig,
|
|
||||||
test: {
|
|
||||||
...defaultProjectTestConfig,
|
|
||||||
name: "items",
|
|
||||||
include: ["src/test/items/**/*.{test,spec}.ts"],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
...defaultConfig,
|
|
||||||
test: {
|
|
||||||
...defaultProjectTestConfig,
|
|
||||||
name: "moves",
|
|
||||||
include: ["src/test/moves/**/*.{test,spec}.ts"],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
"./vitest.config.ts",
|
"./vitest.config.ts",
|
||||||
]);
|
]);
|
||||||
|
Loading…
Reference in New Issue
Block a user