Skip to content

chore: add tests.yml build action to run tests on PR / master. #177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: react-query tests

on:
push:
branches:
- 'master'
pull_request:

jobs:
test:
name: 'node ${{ matrix.node }} ${{ matrix.os }} '
runs-on: '${{ matrix.os }}'
strategy:
matrix:
os: [ubuntu-latest]
node: [12, 10]
steps:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2-beta
with:
fetch-depth: 1
- run: npm i -g yarn
- run: yarn --frozen-lockfile
- run: yarn test:ci
12 changes: 12 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
"coverageThreshold": {
"global": {
"branches": 65.38,
"functions": 67.65,
"lines": 72.75,
"statements": 71.54
}
},
collectCoverage: true,
coverageReporters: ["json", "lcov", "text", "clover", "text-summary"]
}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@
"scripts": {
"test": "is-ci \"test:ci\" \"test:dev\"",
"test:dev": "jest --watch",
"test:ci": "yarn test:jest",
"test:jest": "jest --coverage",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note, i moved this into jest.config.js

"test:coverage": "yarn test:jest; open coverage/lcov-report/index.html",
"test:ci": "jest",
"test:coverage": "yarn test:ci; open coverage/lcov-report/index.html",
"build": "NODE_ENV=production rollup -c",
"now-build": "yarn && cd www && yarn && yarn build",
"start": "rollup -c -w",
Expand Down