2023-09-04 19:08:18 +01:00
|
|
|
# Node.js Test Runner
|
|
|
|
|
|
|
|
Documentation: https://nodejs.org/api/test.html
|
|
|
|
|
|
|
|
Create a test file in this directory with the name `*.js`.
|
|
|
|
|
|
|
|
## Template
|
|
|
|
|
|
|
|
```js
|
2024-08-24 17:38:50 +01:00
|
|
|
const test = require("node:test");
|
2023-09-04 19:08:18 +01:00
|
|
|
const assert = require("node:assert");
|
|
|
|
|
|
|
|
test("Test name", async (t) => {
|
|
|
|
assert.strictEqual(1, 1);
|
|
|
|
});
|
|
|
|
```
|
|
|
|
|
2023-10-02 22:48:21 +01:00
|
|
|
## Run
|
2023-09-04 19:08:18 +01:00
|
|
|
|
|
|
|
```bash
|
2024-08-24 17:38:50 +01:00
|
|
|
npm run test-backend
|
2023-09-04 19:08:18 +01:00
|
|
|
```
|