Initial Commit
This commit is contained in:
63
packages/localization/i18n/react-i18n/vitest.config.ts
Normal file
63
packages/localization/i18n/react-i18n/vitest.config.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig } from "vitest/config";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
test: {
|
||||
globals: false,
|
||||
environment: "happy-dom",
|
||||
pool: "forks",
|
||||
fileParallelism: false,
|
||||
// Inline @suaveplan/i18n so its bundled @opentelemetry/api copy
|
||||
// (shipped as ESM under a CJS package.json) is transformed into
|
||||
// ESM-compatible code by Vite before vitest evaluates it. Without
|
||||
// this, importing anything from `@suaveplan/i18n` from a *.test.tsx
|
||||
// file under happy-dom errors with "Cannot use import statement
|
||||
// outside a module" on the first OTel pull-in.
|
||||
server: {
|
||||
deps: {
|
||||
inline: ["@suaveplan/i18n", "@opentelemetry/api"],
|
||||
},
|
||||
},
|
||||
setupFiles: [
|
||||
"@suaveplan/testing/polyfills",
|
||||
"./tests/setup/polyfills.ts",
|
||||
],
|
||||
include: [
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.test.tsx",
|
||||
"tests/**/*.test.ts",
|
||||
"tests/**/*.test.tsx",
|
||||
],
|
||||
exclude: [
|
||||
"src/__benchmarks__/**",
|
||||
"benchmarks/**",
|
||||
"e2e/**",
|
||||
"dist/**",
|
||||
"node_modules/**",
|
||||
],
|
||||
coverage: {
|
||||
provider: "istanbul",
|
||||
reporter: ["text", "html", "lcov"],
|
||||
include: ["src/**/*.ts", "src/**/*.tsx"],
|
||||
exclude: [
|
||||
"src/**/*.test.ts",
|
||||
"src/**/*.test.tsx",
|
||||
"src/**/*.bench.ts",
|
||||
"src/**/*.schemas.ts",
|
||||
"src/**/*.types.ts",
|
||||
"src/**/*.stories.tsx",
|
||||
"src/**/index.ts",
|
||||
"src/__benchmarks__/**",
|
||||
"tests/**",
|
||||
],
|
||||
thresholds: {
|
||||
statements: 100,
|
||||
branches: 100,
|
||||
functions: 100,
|
||||
lines: 100,
|
||||
},
|
||||
},
|
||||
testTimeout: 5000,
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user