Skip to content

Commit

Permalink
fix: svelte preprocessor unit tests run in CI (#900)
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinderoubaix authored Sep 2, 2024
1 parent bc3f7c8 commit 946ebc7
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- run: npm run test:coverage
- uses: codecov/codecov-action@v4
with:
files: core/coverage/lcov.info,core-bootstrap/coverage/lcov.info,angular/headless/coverage/lcov.info
files: core/coverage/lcov.info,core-bootstrap/coverage/lcov.info,angular/headless/coverage/lcov.info,svelte/preprocess/coverage/lcov.info
flags: unit
disable_search: true
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
8 changes: 7 additions & 1 deletion code-coverage/lib/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import path from 'path';
export const rootFolder = path.join(import.meta.dirname, '..', '..', '..');

export const filter = createFilter(
['core/src/**/*', 'core-bootstrap/src/**/*', 'angular/{headless,lib}/src/**/*', 'react/{headless,lib}/src/**/*', 'svelte/{headless,lib}/src/**/*'],
[
'core/src/**/*',
'core-bootstrap/src/**/*',
'angular/{headless,bootstrap}/src/**/*',
'react/{headless,bootstrap}/src/**/*',
'svelte/{headless,bootstrap}/src/**/*',
],
['node_modules', '**/*.spec.ts', '**/__mocks__/**'],
{
resolve: rootFolder,
Expand Down
3 changes: 2 additions & 1 deletion svelte/preprocess/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"check": "wireit",
"tdd": "vitest",
"tdd:ui": "vitest --ui",
"test": "tsc -p test/tsconfig.json && vitest run"
"test": "tsc -p test/tsconfig.json && vitest run",
"test:coverage": "vitest run --coverage"
},
"wireit": {
"build:src": {
Expand Down
9 changes: 9 additions & 0 deletions svelte/preprocess/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
"include": ["files"],
"files": ["test.spec.ts", "vite-env.d.ts"],
"compilerOptions": {
"noEmit": true,
"emitDeclarationOnly": false
}
}
2 changes: 1 addition & 1 deletion svelte/preprocess/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default defineConfig({
test: {
include: ['./test/**/*.spec.ts'],
coverage: {
reporter: ['text', 'json', 'html'],
reporter: ['text', 'json', 'html', 'lcov'],
},
},
});

0 comments on commit 946ebc7

Please sign in to comment.