mirror of
https://github.com/kremalicious/blog.git
synced 2024-12-22 17:23:50 +01:00
add GitHub test workflow
This commit is contained in:
parent
91f2df7bb9
commit
7bd04c6d88
39
.github/workflows/test.yml
vendored
Normal file
39
.github/workflows/test.yml
vendored
Normal file
@ -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 }}
|
@ -11,9 +11,6 @@ describe('Icon', () => {
|
|||||||
rerender(<Icon name={'Download'} />)
|
rerender(<Icon name={'Download'} />)
|
||||||
expect(container.firstChild.nodeName).toBe('svg')
|
expect(container.firstChild.nodeName).toBe('svg')
|
||||||
|
|
||||||
rerender(<Icon name={'Blog'} />)
|
|
||||||
expect(container.firstChild.nodeName).toBe('svg')
|
|
||||||
|
|
||||||
rerender(<Icon name={'Twitter'} />)
|
rerender(<Icon name={'Twitter'} />)
|
||||||
expect(container.firstChild.nodeName).toBe('svg')
|
expect(container.firstChild.nodeName).toBe('svg')
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user