Skip to content

Commit

Permalink
split vite and vitest configs
Browse files Browse the repository at this point in the history
  • Loading branch information
jgerigmeyer committed Mar 11, 2024
1 parent 48b5c7b commit 1a28164
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 33 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"svelte-check": "^3.6.6",
"ts-node": "^10.9.2",
"typescript": "^5.4.2",
"vite": "^5.1.5",
"vite": "^5.1.6",
"vitest": "^1.3.1"
},
"packageManager": "[email protected]"
Expand Down
1 change: 1 addition & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"../.eslintrc.cjs",
"../svelte.config.js",
"../vite.config.ts",
"../vitest.config.ts",
"../src/**/*.d.ts"
]
}
27 changes: 0 additions & 27 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/// <reference types="vitest" />

import { sveltekit } from '@sveltejs/kit/vite';
import path from 'path';
import { NodePackageImporter } from 'sass';
Expand All @@ -15,29 +13,4 @@ export default defineConfig({
},
},
},
/**
* @see https://vitest.dev/config/#configuration
*/
test: {
include: ['./test/js/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
globals: true,
environment: 'jsdom',
watch: false,
setupFiles: './test/js/setup.js',
clearMocks: true,
reporters: 'dot',
coverage: {
enabled: true,
reporter: ['text-summary', 'html'],
include: ['src/**/*.{js,ts,svelte}'],
exclude: [
'src/**/*.d.ts',
'src/routes/styleguide/**/*',
'src/routes/+layout.*',
],
all: true,
skipFull: true,
reportOnFailure: true,
},
},
});
34 changes: 34 additions & 0 deletions vitest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { defineConfig, mergeConfig } from 'vitest/config';

import viteConfig from './vite.config.js';

/**
* @see https://vitest.dev/config/#configuration
*/
export default mergeConfig(
viteConfig,
defineConfig({
test: {
include: ['./test/js/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
globals: true,
environment: 'jsdom',
watch: false,
setupFiles: './test/js/setup.js',
clearMocks: true,
reporters: 'dot',
coverage: {
enabled: true,
reporter: ['text-summary', 'html'],
include: ['src/**/*.{js,ts,svelte}'],
exclude: [
'src/**/*.d.ts',
'src/routes/styleguide/**/*',
'src/routes/+layout.*',
],
all: true,
skipFull: true,
reportOnFailure: true,
},
},
}),
);
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6438,7 +6438,7 @@ __metadata:
svelte-check: "npm:^3.6.6"
ts-node: "npm:^10.9.2"
typescript: "npm:^5.4.2"
vite: "npm:^5.1.5"
vite: "npm:^5.1.6"
vitest: "npm:^1.3.1"
languageName: unknown
linkType: soft
Expand Down Expand Up @@ -9452,9 +9452,9 @@ __metadata:
languageName: node
linkType: hard

"vite@npm:^5.1.5":
version: 5.1.5
resolution: "vite@npm:5.1.5"
"vite@npm:^5.1.6":
version: 5.1.6
resolution: "vite@npm:5.1.6"
dependencies:
esbuild: "npm:^0.19.3"
fsevents: "npm:~2.3.3"
Expand Down Expand Up @@ -9488,7 +9488,7 @@ __metadata:
optional: true
bin:
vite: bin/vite.js
checksum: 10/ada0a9138ca541723008ee261d80a97f6b70173508ded0f87834e2142660f45dff9801d143551aa3a8979ed446f0aec71ae114ab3ae978b3fbd5cf1f8c4bc331
checksum: 10/f48073e93ead62fa58034398442de4517c824b3e50184f8b4059fb24077a26f2c04e910e29d7fb7ec51ea53eb61b9c7d94d56b14a38851de80c67480094cc79d
languageName: node
linkType: hard

Expand Down

0 comments on commit 1a28164

Please sign in to comment.