diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..2bf975d --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,45 @@ +name: 'Tests' + +on: + push: + branches: + - main + pull_request: + paths-ignore: + - '**.md?' + +jobs: + lint: + name: 'lint (node: 20)' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + repository: 'strapi/blocks-react-renderer' + persist-credentials: false + - uses: actions/setup-node@v3 + with: + node-version: 20 + - name: 'Install dependencies for linting' + run: yarn install + - name: 'Run lint' + run: yarn lint + + unit_tests: + name: 'unit_tests (node: ${{ matrix.node }})' + runs-on: ubuntu-latest + strategy: + matrix: + node: [20] + steps: + - uses: actions/checkout@v4 + with: + repository: 'strapi/blocks-react-renderer' + persist-credentials: false + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + - name: 'Run install' + run: yarn install + - name: 'Run tests' + run: yarn test diff --git a/tests/BlocksRenderer.test.tsx b/tests/BlocksRenderer.test.tsx index 04ec66e..1000fc3 100644 --- a/tests/BlocksRenderer.test.tsx +++ b/tests/BlocksRenderer.test.tsx @@ -218,6 +218,7 @@ describe('BlocksRenderer', () => { createdAt: '2021-01-01', updatedAt: '2021-01-01', }, + children: [{ type: 'text', text: '' }], }, ]} /> @@ -354,7 +355,6 @@ describe('BlocksRenderer', () => { { type: 'text', text: 'Still my paragraph', - // @ts-expect-error unknown is an invalid modifier unknown: true, }, ],