Skip to content

Commit ad968be

Browse files
authored
chore: add github workflow (#5)
* chore: add github workflow * Fix tests * update github actions deps * only run node 20
1 parent e15f227 commit ad968be

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

.github/workflows/tests.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: 'Tests'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
paths-ignore:
9+
- '**.md?'
10+
11+
jobs:
12+
lint:
13+
name: 'lint (node: 20)'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
repository: 'strapi/blocks-react-renderer'
19+
persist-credentials: false
20+
- uses: actions/setup-node@v3
21+
with:
22+
node-version: 20
23+
- name: 'Install dependencies for linting'
24+
run: yarn install
25+
- name: 'Run lint'
26+
run: yarn lint
27+
28+
unit_tests:
29+
name: 'unit_tests (node: ${{ matrix.node }})'
30+
runs-on: ubuntu-latest
31+
strategy:
32+
matrix:
33+
node: [20]
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
repository: 'strapi/blocks-react-renderer'
38+
persist-credentials: false
39+
- uses: actions/setup-node@v3
40+
with:
41+
node-version: ${{ matrix.node }}
42+
- name: 'Run install'
43+
run: yarn install
44+
- name: 'Run tests'
45+
run: yarn test

tests/BlocksRenderer.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ describe('BlocksRenderer', () => {
218218
createdAt: '2021-01-01',
219219
updatedAt: '2021-01-01',
220220
},
221+
children: [{ type: 'text', text: '' }],
221222
},
222223
]}
223224
/>
@@ -354,7 +355,6 @@ describe('BlocksRenderer', () => {
354355
{
355356
type: 'text',
356357
text: 'Still my paragraph',
357-
// @ts-expect-error unknown is an invalid modifier
358358
unknown: true,
359359
},
360360
],

0 commit comments

Comments
 (0)