From 7bd04c6d88ec2aa3e7f8ca81c4c94b1449ff125d Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 17 Nov 2019 02:32:16 +0100 Subject: [PATCH] add GitHub test workflow --- .github/workflows/test.yml | 39 ++++++++++++++++++++++++++++++ src/components/atoms/Icon.test.tsx | 3 --- 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..355a6903 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,39 @@ +name: Test + +on: [push] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: '12.x' + + - name: Cache node modules + uses: actions/cache@v1 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.os }}-node- + + - name: Cache Gatsby build output + uses: actions/cache@v1 + with: + path: public + key: ${{ runner.os }}-public + + - name: Install Dependencies + run: npm ci + + - name: Test + run: npm test + + - name: Build + run: npm run build + env: + CI: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/src/components/atoms/Icon.test.tsx b/src/components/atoms/Icon.test.tsx index d1e20fc6..bfbfd93c 100644 --- a/src/components/atoms/Icon.test.tsx +++ b/src/components/atoms/Icon.test.tsx @@ -11,9 +11,6 @@ describe('Icon', () => { rerender() expect(container.firstChild.nodeName).toBe('svg') - rerender() - expect(container.firstChild.nodeName).toBe('svg') - rerender() expect(container.firstChild.nodeName).toBe('svg') })