Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 28 Next »

In order to collect coverage information SeaLights agents need to first scan the javascript files for the build information.

Scanning a build

Scanning a build in Node.js is done using the Node.js Build scanner with the build flag.

Unix:
./node_modules/.bin/slnodejs build --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId --workspacepath "." --scm git --es6Modules

Windows:
call .\node_modules\.bin\slnodejs build --tokenfile \path\to\sltoken.txt --buildsessionidfile buildSessionId --workspacepath "." --scm git --es6Modules

For React applications, you should add the flag: --babylonPlugin jsx
To scan both ts & tsx files you should add the flag: --babylonPlugins typescript,jsx

In order to ignore specific files or folders during the Scan operation, please refer to https://sealights.atlassian.net/l/c/n6GuFwok

See 'Node.js Command Reference - Scanning a build' for full parameter details

Scanning multi modules

If you want to report separate parts of the application as separate modules, you can do so with the --uniqueModuleId option.

Unix:
./node_modules/.bin/slnodejs build --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId --workspacepath "." --scm git --uniqueModuleId module-name --es6Modules

Windows:
call .\node_modules\.bin\slnodejs build --tokenfile \path\to\sltoken.txt --buildsessionidfile buildSessionId --workspacepath "." --scm git --uniqueModuleId module-name --es6Modules

It is important to always use the exact same module names each time you report a new build.

When you finish reporting all the modules, you need to send the event with the buildend command and either the --ok or --failed depending on the result of your build process.

Unix:
./node_modules/.bin/slnodejs buildend --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId --ok

Windows:
call .\node_modules\.bin\slnodejs buildend --tokenfile \path\to\sltoken.txt --buildsessionidfile buildSessionId --ok
  • No labels