> For the complete documentation index, see [llms.txt](https://docs.sealights.io/knowledgebase/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/capturing-tests/other-test-frameworks.md).

# Other Test Frameworks

Use this page for test frameworks that have no SeaLights integration. There are two ways to get their coverage to SeaLights; prefer the first when the framework can produce it.

| The framework can write                               | Use                                                     | Example frameworks                                                                                   |
| ----------------------------------------------------- | ------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| An NYC (Istanbul) JSON report (`coverage-final.json`) | `nycReport` + `uploadReports`                           | Vitest with `@vitest/coverage-istanbul`, Jest with `--coverageReporters=json`, Karma, AVA with `nyc` |
| No coverage report                                    | `slnodejs run --useinitialcolor true` + `uploadReports` | Jasmine and other CommonJS runners                                                                   |

**What you get in both cases:** coverage and test results per test stage. Coverage is not split per test, and Test Impact Analysis does not skip tests. For Mocha, Jest, Cypress, Playwright, Cucumber.js and TestCafe, use their integrations instead; see [Capturing Tests](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/capturing-tests.md).

## Frameworks that write an NYC report <a href="#nyc-report" id="nyc-report"></a>

Follow [Unit Tests](https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/capturing-tests/unit-tests.md). For example, with Vitest:

```bash
npm install --save-dev @vitest/coverage-istanbul
npx slnodejs openTestStage --tokenFile sltoken.txt --buildSessionIdFile buildSessionId --testStage "Unit Tests"
npx vitest run --coverage.enabled --coverage.provider=istanbul --coverage.reporter=json \
  --reporter=junit --outputFile=reports/junit.xml
npx slnodejs nycReport --tokenFile sltoken.txt --buildSessionIdFile buildSessionId --report coverage/coverage-final.json
npx slnodejs uploadReports --tokenFile sltoken.txt --buildSessionIdFile buildSessionId --file reports/junit.xml
npx slnodejs closeTestStage --tokenFile sltoken.txt --buildSessionIdFile buildSessionId --testStage "Unit Tests"
```

## Frameworks without a coverage report <a href="#run" id="run"></a>

`slnodejs run` starts the test runner with the test listener, which collects coverage for the whole run. Run the framework through its JavaScript entry file (not the shell wrapper in `node_modules/.bin`), after `--`:

```bash
printf '%s' "$SEALIGHTS_AGENT_TOKEN" > sltoken.txt

npx slnodejs openTestStage --tokenFile sltoken.txt --buildSessionIdFile buildSessionId --testStage "Unit Tests"

npx slnodejs run --tokenFile sltoken.txt --buildSessionIdFile buildSessionId \
  --useinitialcolor true -- node_modules/jasmine/bin/jasmine.js

npx slnodejs uploadReports --tokenFile sltoken.txt --buildSessionIdFile buildSessionId --file reports/junit.xml
npx slnodejs closeTestStage --tokenFile sltoken.txt --buildSessionIdFile buildSessionId --testStage "Unit Tests"
```

* `--useinitialcolor true` reports the coverage of the run even though no individual test is identified. The flag takes a value.
* Upload the results while the test stage is open, and without `--testStage`: `uploadReports --testStage` opens and closes a test stage of its own.
* Configure the framework to write a JUnit XML report (for example `jasmine-reporters` for Jasmine).
* The `bin` field of the framework's `package.json` names its entry file.
* If the framework runs the tests in child processes, set `SL_enableChildProcessPatcher=true` so the test listener also starts in those processes.
* Add `--es6Modules` if the code under test is ES modules.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sealights.io/knowledgebase/setup-and-configuration/sealights-agents-and-plugins/node.js-agent/capturing-tests/other-test-frameworks.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
