Skip to content

Commit 848ec9c

Browse files
committed
🐛 fix(test): Adjust the test coverage, otherwise the unrelated file will be covered
1 parent 62f0b62 commit 848ec9c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"build": "tsc && vite build",
5757
"preview": "vite preview",
5858
"test": "vitest",
59-
"test:watch": "vitest watch",
59+
"test:watch": "vitest watch --coverage",
6060
"test:ci": "vitest run --coverage",
6161
"stylelint": "stylelint --fix --cache --quiet --max-warnings 0 --config .stylelintrc.cjs \"**/*.{css,less,scss,sass,stylus,styl}\"",
6262
"eslint": "eslint . --fix --cache --quiet --report-unused-disable-directives --max-warnings 0 --ext .js,.cjs,.jsx,.ts,.cts,.tsx"

vite.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ export default defineConfig({
3939
globals: true,
4040
setupFiles: './vitest-setup.ts',
4141
environment: 'jsdom',
42-
exclude: ['src/__visual_tests__', '**/node_modules/**', '**/dist/**', '**/cypress/**', '**/.{idea,git,cache,output,temp}/**']
42+
include: ['src/overlay-scrollbars-smooth/__test__/**'],
43+
exclude: ['**/node_modules/**', '**/dist/**'],
44+
coverage: {
45+
include: ['src/overlay-scrollbars-smooth/**/*.{ts,tsx}'],
46+
exclude: ['src/overlay-scrollbars-smooth/index.ts', 'src/overlay-scrollbars-smooth/SmoothScroll.ts', 'src/overlay-scrollbars-smooth/interfaces.d.ts']
47+
}
4348
},
4449
css: {
4550
modules: {

0 commit comments

Comments
 (0)