diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0e40174..259ea9a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,16 +27,26 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 20 - name: Install dependencies run: npm install - name: Run tests - run: npm run test + run: npx vitest run --coverage env: CI: true + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + directory: ./coverage/ + flags: unittest + name: codecov-umbrella + fail_ci_if_error: true + verbose: true + - name: Display test results if: failure() run: | diff --git a/vite.config.js b/vite.config.js index 0d082ad..820fbae 100644 --- a/vite.config.js +++ b/vite.config.js @@ -8,7 +8,7 @@ export default defineConfig({ coverage: { provider: 'v8', reportsDirectory: './coverage', - reporter: ['html'], + reporter: ['html', 'json'], all: true, exclude: ['**/tests', '.svelte-kit', 'build', 'coverage', 'node_modules'] }