In addition to mochitests and xpcshell tests, some panels in DevTools are using node test libraries to run unit tests. For instance, several panels are using [Jest](https://jestjs.io/) to run React component unit tests.
To run the DevTools node tests on try, you can use `./mach try fuzzy` and look for the jobs named `source-test-node-debugger-tests` and `source-test-node-devtools-tests`.
They are also run when using the "devtools" preset: `./mach try --preset devtools`.
### Node tests try job definition
The definition of those try jobs can be found at [taskcluster/ci/source-test/node.yml](https://searchfox.org/mozilla-central/source/taskcluster/ci/source-test/node.yml).
The definition also contains the list of files that will trigger the node test jobs. Currently the debugger tests run when any file is modified under `devtools/client/debugger`, the devtools tests run when any file is modified under `devtools/client` or `devtools/shared`.
At the moment of writing, the supported suites for this script are: `aboutdebugging`, `accessibility`, `application`, `compatibility`, `framework`, `netmonitor`, `webconsole`.
Alternatively, you can also locate the `package.json` corresponding to a given suite, and run `yarn && yarn test`.
## Updating snapshots
Some of the node tests are snapshot tests, which means they compare the output of a given component to a previous text snapshot. They might break if you are legitimately modifying a component and it means the snapshots need to be updated.
A snapshot failure will show up as follows:
```
› 1 snapshot failed from 1 test suite
```
It should also mention the command you can run to update the snapshots:
```
Inspect your code changes or run `yarn run test-ci -u` to update them.
```
For example, if you need to update snapshots in a specific panel, first locate the package.json corresponding to the node test folder of the panel. In theory it should be under `devtools/client/{panelname}/test/node/` but it might be slightly different depending on each panel. Then run `yarn run test-ci -u` in this folder and add the snapshot changes to your commit.