diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..91d40a0 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,20 @@ +name: Check the source code +on: + pull_request: + branches: + - main + push: + branches: + - main +jobs: + test: + name: Unit tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install packages + run: yarn + - name: Test + run: yarn ci:jest + - name: Lint + run: yarn ci:lint-js diff --git a/package.json b/package.json index f809e08..cff636e 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,8 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "jest --watch", + "ci:jest": "jest --ci", + "ci:lint-js": "eslint --ext .js,.jsx ./", "eject": "react-scripts eject", "lint": "eslint './**/*.{js,jsx}' --fix", "prepare": "husky install" diff --git a/src/setupTests.js b/src/setupTests.js index 1dd407a..ddaca98 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -2,4 +2,5 @@ // allows you to do things like: // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom +// eslint-disable-next-line import/no-extraneous-dependencies import "@testing-library/jest-dom";