Skip to main content

test: cover normal behavior and edge cases

GBB Demo authored on Nov 2, 2026

parent 1ebffdacommit 64b10402a428

2 files changed, +18 −0

  • package.json+9 −0
    @@ -1,0 +1,9 @@
    1+{
    2+ "name": "docs-portal",
    3+ "version": "0.1.0",
    4+ "private": true,
    5+ "type": "module",
    6+ "scripts": {
    7+ "test": "node test.mjs"
    8+ }
    9+}
  • test.mjs+9 −0
    @@ -1,0 +1,9 @@
    1+import assert from "node:assert/strict";
    2+import * as app from "./app.mjs";
    3+
    4+assert.equal(app.slug(" Getting Started! "), "getting-started");
    5+assert.equal(app.slug("Café Guide"), "cafe-guide");
    6+assert.equal(app.search([{title: "Start", body: "Install the CLI"}], " cli ").length, 1);
    7+assert.equal(app.search([{title: "Start", body: "Install"}], "missing").length, 0);
    8+
    9+console.log("All checks passed");