Skip to content

Commit 3045261

Browse files
Merge pull request #5 from Unleash/gh-action-build
add GH action to build/lint/test/coverage
2 parents 2e533e7 + a8b1c6a commit 3045261

File tree

4 files changed

+46
-4
lines changed

4 files changed

+46
-4
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Build and test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v6
19+
- name: Setup node
20+
uses: actions/setup-node@v6
21+
with:
22+
node-version: 22.x
23+
cache: npm
24+
25+
- name: Install
26+
run: npm ci
27+
28+
- name: Lint validation
29+
run: npm run lint
30+
31+
- name: Build
32+
run: npm run build
33+
- name: Test & coverage
34+
run: npm run test:coverage
35+
36+
# - name: Coveralls
37+
# uses: coverallsapp/github-action@v2
38+
# with:
39+
# github-token: ${{ secrets.GITHUB_TOKEN }}
40+
# format: lcov
41+
# file: ./coverage/lcov.info

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"type-check": "tsc --noEmit",
2727
"lint": "eslint src",
2828
"lint:fix": "eslint src --fix",
29-
"test": "vitest",
29+
"test": "vitest run",
3030
"test:ui": "vitest --ui",
31-
"test:coverage": "vitest --coverage",
32-
"serve:example": "npx serve -p 3000 .",
31+
"test:coverage": "vitest run --coverage",
32+
"serve:example:vanilla": "npx serve -p 3000 .",
3333
"serve:example:react": "cd examples/react && npm run dev",
3434
"serve:example:nextjs": "cd examples/nextjs && npm run dev",
3535
"serve:example:angular": "cd examples/angular && npm start",

src/wrapper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export function wrapUnleashClient(
2525
const updateListeners = new Set<() => void>();
2626

2727
// Reference to the final proxy (will be assigned below)
28+
// eslint-disable-next-line prefer-const
2829
let proxyClient: WrappedUnleashClient;
2930

3031
// Create a partial object with only the methods we're intercepting.

vitest.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default defineConfig({
88
exclude: ['node_modules/**', 'dist/**', 'examples/**'],
99
coverage: {
1010
provider: 'v8',
11-
reporter: ['text', 'json', 'html'],
11+
reporter: ['text', 'json', 'html', 'lcov'],
1212
exclude: [
1313
'node_modules/**',
1414
'dist/**',

0 commit comments

Comments
 (0)