...
Create a file
config.json
- with content similar to the one below (that allowssealights
,mocha-allure
, andJUnit
reporters together) for example:Code Block { "reporterEnabled": "slnodejs/tsOutputs/mocha-reporter/index, allure-mocha, mocha-junit-reporter", "seaLightsReporterReporterOptions": {}, "mochaJunitReporterReporterOptions": { "mochaFile": "results/junit-custom.xml" }, "allureMochaReporterOptions": { "resultsDir": "results/allure" } }
When you run slnodejs mocha run it with the following additional parameters:
Code Block npx slnodejs mocha --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId ... -- --reporter-options configFile=config.json
Mapping Functional Tests to Mocha Suites
In some functional testing configurations, a Mocha Suite may represent the overall functional test, while the Mocha tests within the suite correspond to individual test steps. For compatibility with this configuration, we allow you to pass the reportSuites
flag (as a reporterOption
) to map Sealights Tests to Mocha Suites instead of the Mocha tests themselves.
The flag is disabled by default (false
), but when set to true
, Sealights treats each suite as a single functional test, providing a better alignment with Coverage Analytics and Test Optimization.
Code Block |
---|
npx slnodejs mocha --tokenfile /path/to/sltoken.txt --buildsessionidfile buildSessionId ... -- --reporter-options reportSuites=true |