#Install the project dependencies
npm install
# transpile the code with source maps to the dist folder
npm run build
# Install the SeaLights agents
npm i slnodejs
# Create a SeaLights ignore file to only include the src folder
echo '**/vendor*.js' > .slignore
echo '**/polyfills*.js' >> .slignore
# Scan the source files to provide SeaLights the structure of the project
./node_modules/.bin/
npx slnodejs scan --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId --instrumentForBrowsers --outputpath sl_dist --workspacepath dist --scm git --projectRoot `pwd`
# Notify SeaLights the Unit Tests are starting
./node_modules/.bin/
npx slnodejs start --tokenfile sltoken.txt --buildsessionidfile buildSessionId.txt --testStage "Unit Tests"
# Run the unit tests while ignoring the error code returned from Jest if the tests fail
# this should be with source maps, coverage enabled and junit report enabled
set +e
npm run test
set -e
# Upload the coverage and tests results to SeaLights
./node_modules/.bin/npx slnodejs nycReport --tokenfile sltoken.txt --buildsessionidfile buildSessionId.txt
./node_modules/.bin/npx slnodejs uploadReports --tokenfile sltoken.txt --buildsessionidfile buildSessionId.txt --reportFile junit.xml
# Notify SeaLights the Unit Tests have finished
./node_modules/.bin/
npx slnodejs end --tokenfile sltoken.txt --buildsessionidfile buildSessionId.txt |