Skip to content

Commit 9b71491

Browse files
committed
chore: add test suite to CI
1 parent cf4229d commit 9b71491

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,23 @@ jobs:
4444
- name: Lint
4545
run: pnpm lint
4646

47+
test:
48+
name: test
49+
runs-on: ubuntu-latest
50+
needs: cache
51+
steps:
52+
- uses: actions/checkout@v4
53+
- uses: pnpm/action-setup@v3
54+
- uses: actions/setup-node@v4
55+
with:
56+
node-version-file: '.nvmrc'
57+
cache: 'pnpm'
58+
- name: remove git auth
59+
run: git config --unset http.https://github.com/.extraheader
60+
- run: pnpm install --frozen-lockfile
61+
- name: Test
62+
run: pnpm test:ci
63+
4764
build-and-release:
4865
name: build and release
4966
runs-on: ubuntu-latest

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ input.addEventListener('change', async function () {
6868
});
6969
```
7070

71-
>If you prefer, you can import this library using unpkg:
72-
>`<script defer src="https://unpkg.com/@frsource/is-animated"></script>`
71+
> If you prefer, you can import this library using unpkg:
72+
> `<script defer src="https://unpkg.com/@frsource/is-animated"></script>`
7373
7474
### Usage in Node.js
7575

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"release:test": "pnpm release --no-git-tag-version --no-push --skip-npm",
2121
"clean": "pnpm rimraf dist docs",
2222
"test": "pnpm vitest",
23+
"test:ci": "pnpm vitest run --coverage",
2324
"coverage": "pnpm vitest --coverage"
2425
},
2526
"homepage": "https://www.frsource.org/is-animated",

vitest.config.mts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { defineConfig } from 'vitest/config';
1+
import { defineConfig, coverageConfigDefaults } from 'vitest/config';
22

33
export default defineConfig({
44
test: {
55
coverage: {
66
include: ['src/**'],
7+
exclude: [...coverageConfigDefaults.exclude, 'src/types.mjs'],
78
thresholds: { statements: 90, functions: 90, branches: 90, lines: 90 },
89
},
910
},

0 commit comments

Comments
 (0)