diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000000..a3b6e0dd07 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000000..ce496f020a --- /dev/null +++ b/jest.config.js @@ -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"] +} diff --git a/package.json b/package.json index 7644b48965..2c09ba5c40 100644 --- a/package.json +++ b/package.json @@ -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", - "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",