From 6a3ef0f790d88780dbd5370804c684b19d282e1b Mon Sep 17 00:00:00 2001 From: max Date: Mon, 1 Aug 2022 23:22:44 +0300 Subject: [PATCH] chore: tests config --- package.json | 2 +- src/config/cultureSets.test.ts | 2 -- src/utils/arrayUtils.test.ts | 2 -- tsconfig.json | 1 + vite.config.js | 4 +++- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 4bb0d3d7..4ee3b0c0 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "dev": "vite", "build": "tsc && vite build", "preview": "vite preview", - "test": "vitest --reporter verbose", + "test": "vitest", "coverage": "vitest run --coverage" }, "devDependencies": { diff --git a/src/config/cultureSets.test.ts b/src/config/cultureSets.test.ts index 0f79a2ed..31c1cb88 100644 --- a/src/config/cultureSets.test.ts +++ b/src/config/cultureSets.test.ts @@ -1,5 +1,3 @@ -import {vi, describe, it, expect} from "vitest"; - vi.stubGlobal("Names", { getBase: () => 0, getBaseShort: () => "TestName" diff --git a/src/utils/arrayUtils.test.ts b/src/utils/arrayUtils.test.ts index 6456e72d..63e4a090 100644 --- a/src/utils/arrayUtils.test.ts +++ b/src/utils/arrayUtils.test.ts @@ -1,5 +1,3 @@ -import {describe, it, expect} from "vitest"; - import {sliceFragment} from "./arrayUtils"; describe("sliceFragment", () => { diff --git a/tsconfig.json b/tsconfig.json index 3adf2c27..3f25b627 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,7 @@ "noUnusedParameters": true, "noImplicitReturns": true, "skipLibCheck": true, + "types": ["vitest/globals"], "baseUrl": "src" }, "include": ["src"] diff --git a/vite.config.js b/vite.config.js index 7df7e1c7..eeb9e32f 100644 --- a/vite.config.js +++ b/vite.config.js @@ -64,7 +64,9 @@ export default defineConfig(({mode}) => { } }, test: { - environment: "happy-dom" + globals: true, + environment: "happy-dom", + reporters: ["verbose"] }, resolve: { alias: [