You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
1 day ago | |
|---|---|---|
| .. | ||
| monitor-conditions | 1 month ago | |
| monitors | 6 days ago | |
| notification-providers | 1 month ago | |
| README.md | 1 month ago | |
| check-translations.test.js | 1 month ago | |
| test-cert-hostname-match.js | 2 months ago | |
| test-domain.js | 1 month ago | |
| test-globalping.js | 1 day ago | |
| test-migration.js | 1 month ago | |
| test-monitor-response.js | 1 month ago | |
| test-snmp.js | 1 month ago | |
| test-status-page.js | 4 weeks ago | |
| test-system-service.js | 1 month ago | |
| test-uptime-calculator.js | 1 month ago | |
| test-util-server.js | 1 month ago | |
| test-util.js | 1 month ago | |
README.md
Node.js Test Runner
Documentation: https://nodejs.org/api/test.html
Create a test file in this directory with the name *.js.
[!TIP] Writing great tests is hard.
You can make our live much simpler by following this guidance:
- Use
describe()to group related tests- Use
test()for individual test cases- One test per scenario
- Use descriptive test names:
function() [behavior] [condition]- Don't prefix with "Test" or "Should"
Template
const { describe, test } = require("node:test");
const assert = require("node:assert");
describe("Feature Name", () => {
test("function() returns expected value when condition is met", () => {
assert.strictEqual(1, 1);
});
});
Run
npm run test-backend