chore: Cleanup leftover E2E test artifacts (#968)

This commit is contained in:
1natsu
2024-09-05 06:35:18 +09:00
committed by GitHub
parent c143a9978d
commit fbe502fddf
3 changed files with 20 additions and 3 deletions
+1 -1
View File
@@ -6,12 +6,12 @@ export default defineConfig({
test: {
mockReset: true,
restoreMocks: true,
setupFiles: ['vitest.setup.ts'],
testTimeout: 120e3,
coverage: {
include: ['src/**'],
exclude: ['**/dist', '**/__tests__', 'src/utils/testing'],
},
globalSetup: ['./vitest.globalSetup.ts'],
},
server: {
watch: {
+19
View File
@@ -0,0 +1,19 @@
import { exists, rm } from 'fs-extra';
let setupHappened = false;
export async function setup() {
if (setupHappened) {
throw new Error('setup called twice');
}
setupHappened = true;
// @ts-expect-error
globalThis.__ENTRYPOINT__ = 'test';
const e2eDistPath = './e2e/dist/';
if (await exists(e2eDistPath)) {
await rm(e2eDistPath, { recursive: true, force: true });
}
}
-2
View File
@@ -1,2 +0,0 @@
// @ts-expect-error
globalThis.__ENTRYPOINT__ = 'test';