Skip to content

Commit

Permalink
fix: npm run test required depdendencies (#6)
Browse files Browse the repository at this point in the history
The depdendencies for the playground in `examples/playground/node_modules`
have to be installed for the tests to run successfully, since eslint
runs for both projects in one go.

This patch adds a pretest hook to make sure the depdendencies are
installed before running the tests.
  • Loading branch information
usefulthink committed Aug 18, 2023
1 parent f474b52 commit aa04d7a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
${{ runner.os }}-node-
- name: Test
run: |
npm i
npm run test:jest
npm ci
npm run test
- name: Release
uses: cycjimmy/semantic-release-action@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm i
- run: npm run test:jest
- run: npm ci
- run: npm run test
8 changes: 4 additions & 4 deletions examples/playground/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"clean": "rm -rf ./dist",
"test": "run-s test:*",
"prepack": "npm run build",
"pretest": "cd ./examples/playground && ( [ -d ./node_modules ] || npm install )",
"test:tsc": "tsc",
"test:prettier": "prettier -c ./src",
"test:eslint": "eslint './src/**/*ts' './examples/playground/src/*.ts'",
Expand Down

0 comments on commit aa04d7a

Please sign in to comment.