uptime-kuma/test/backend-test
Frank Elsinga 88e7887a87
chore: made code more robust to undefined expiry (#6625)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-06 22:39:11 +00:00
..
monitor-conditions fix fmt 2026-01-01 16:54:34 +01:00
monitors fix(ci): make wss not depend on external dependencys (#6622) 2026-01-06 20:24:06 +00:00
notification-providers Update test/backend-test/notification-providers/test-ntlm.js 2026-01-02 05:38:33 +01:00
check-translations.test.js feat: Added a translation key for “Password is too weak (#6614) 2026-01-06 20:53:51 +00: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 chore: made code more robust to undefined expiry (#6625) 2026-01-06 22:39:11 +00:00
test-migration.js fix(mysql): fix domain_expiry migration for MySQL 8.0 compatibility (#6612) 2026-01-06 21:41:04 +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