Skip to content

Commit

Permalink
chore: add test workflow (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
usefulthink authored Oct 27, 2023
1 parent 10d3d09 commit 177071e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: npm

- name: Install Dependencies
run: npm ci

- name: Run Unit Tests
run: npm test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"build:microbundle": "microbundle -o dist/index.js -f modern,umd --globals react=React,react-dom=ReactDOM --jsx React.createElement --jsxFragment React.Fragment --no-compress --tsconfig tsconfig.build.json",
"start:microbundle": "microbundle watch -o dist/index.js -f modern,umd --globals react=React,react-dom=ReactDOM --jsx React.createElement --jsxFragment React.Fragment --no-compress --tsconfig tsconfig.build.json",
"test:linter": "eslint 'src/**/*.{ts,tsx}'",
"test:tsc": "tsc --project tsconfig.json --noEmit",
"test:tsc": "tsc --project tsconfig.test.json --noEmit",
"test:prettier": "prettier --check ./src ./examples",
"test:unit": "jest",
"test": "npm-run-all -p test:linter test:prettier test:tsc -s test:unit",
Expand Down
7 changes: 7 additions & 0 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "./tsconfig.json",
"exclude": ["./examples"],
"compilerOptions": {
"noEmit": false
}
}

0 comments on commit 177071e

Please sign in to comment.