uptime-kuma/test/backend-test
Markus Reisenhofer d096e2902c
feat(gamedig): Update gamedig implementation to v5 (#4949)
Co-authored-by: Frank Elsinga <frank@elsinga.de>
2026-01-03 05:56:38 +00:00
..
monitor-conditions fix fmt 2026-01-01 16:54:34 +01:00
monitors feat(gamedig): Update gamedig implementation to v5 (#4949) 2026-01-03 05:56:38 +00:00
notification-providers Update test/backend-test/notification-providers/test-ntlm.js 2026-01-02 05:38:33 +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-migration.js improve naming for migration tests 2026-01-01 17:06:29 +01:00
test-status-page.js fix(rss): fix the rss endpoint having the wrong content type (#6570) 2026-01-02 16:02:31 +00:00
test-system-service.js Corrected lining errors resulting from Github "Commit suggestion" choice 2026-01-02 06:56:25 +01:00
test-uptime-calculator.js make sure the calculator uses a suite 2026-01-01 16:25:18 +01:00
test-util.js move the maintenance to the utils test 2026-01-01 17:06:05 +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