Unit Tests
Lifecycle
Commands
npx slnodejs start \
--tokenFile ./sltoken.txt --buildSessionIdFile buildSessionId \
--testStage "Unit Tests"
npm test # runs your tests with nyc, producing coverage-final.json + junit.xml
npx slnodejs uploadReports \
--tokenFile ./sltoken.txt --buildSessionIdFile buildSessionId \
--file ./reports/junit.xml
npx slnodejs nycReport \
--tokenFile ./sltoken.txt --buildSessionIdFile buildSessionId \
--report ./coverage/coverage-final.json
npx slnodejs end \
--tokenFile ./sltoken.txt --buildSessionIdFile buildSessionId- name: Capture unit tests
env:
SL_TOKEN: ${{ secrets.SL_TOKEN }}
run: |
npx slnodejs start --token "$SL_TOKEN" --buildSessionIdFile buildSessionId --testStage "Unit Tests"
npm test
npx slnodejs uploadReports --token "$SL_TOKEN" --buildSessionIdFile buildSessionId --file ./reports/junit.xml
npx slnodejs nycReport --token "$SL_TOKEN" --buildSessionIdFile buildSessionId --report ./coverage/coverage-final.json
npx slnodejs end --token "$SL_TOKEN" --buildSessionIdFile buildSessionIdParameters
Parameter
Purpose
Framework-specific guides
Last updated
Was this helpful?

