-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: create script to run testing coverages
- Loading branch information
Showing
4 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Tests 🧪 | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Bun | ||
uses: oven-sh/setup-bun@v1 | ||
with: | ||
bun-version: latest | ||
|
||
- name: Install dependencies | ||
run: bun install | ||
|
||
- name: Run tests | ||
run: bun run test:coverage | ||
|
||
- name: Publish coverage | ||
uses: romeovs/[email protected] | ||
with: | ||
lcov-file: ./coverage/lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/// <reference types="vitest" /> | ||
/// <reference types="vitest/globals" /> | ||
import react from '@vitejs/plugin-react' | ||
import tsconfigPaths from 'vite-tsconfig-paths' | ||
import { defineConfig } from 'vitest/config' | ||
|
||
export default defineConfig({ | ||
test: { | ||
globals: true, | ||
include: ['**/*.{test,spec}.?(c|m)ts?(x)'], | ||
environment: 'jsdom', | ||
setupFiles: ['./_/env/vitest-setup.ts'], | ||
coverage: { | ||
provider: 'v8', | ||
reporter: ['lcov'], | ||
}, | ||
}, | ||
plugins: [react(), tsconfigPaths()], | ||
ssr: { | ||
target: 'node', | ||
}, | ||
define: { | ||
'import.meta.vitest': undefined, | ||
}, | ||
css: { | ||
postcss: require('./postcss.config.cjs'), | ||
}, | ||
}) |