uptime-kuma/test/backend-test
2026-01-01 17:01:32 +01:00
..
monitor-conditions fix fmt 2026-01-01 16:54:34 +01:00
monitors reword more of our testsuite names 2026-01-01 17:01:32 +01:00
notification-providers move the webhook to a better place 2026-01-01 16:47:31 +01:00
README.md update the readme 2026-01-01 16:51:02 +01:00
test-cert-hostname-match.js cert hostname 2026-01-01 16:39:00 +01:00
test-domain.js move the webhook to a better place 2026-01-01 16:47:31 +01:00
test-maintenance.js fix fmt 2026-01-01 16:54:34 +01:00
test-migration.js reword more of our testsuite names 2026-01-01 17:01:32 +01:00
test-uptime-calculator.js make sure the calculator uses a suite 2026-01-01 16:25:18 +01:00
test-util.js refactor the system utilities test 2026-01-01 16:42:56 +01:00

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