Skip to content

update the workflow to verify the lock file exists #3

update the workflow to verify the lock file exists

update the workflow to verify the lock file exists #3

Workflow file for this run

name: Run Mocha Tests
on:
push:
branches:
- main
- dev
- tests
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: node-express-server
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'yarn'
- name: Verify `yarn.lock` exists
run: |
if [ ! -f node-express-server/yarn.lock ]; then
echo "Error: yarn.lock file is missing in node-express-server directory"
exit 1
fi
- name: Install dependencies
run: yarn install
working-directory: node-express-server
- name: Run Mocha tests
run: npx mocha test/webserver.test.js
working-directory: node-express-server