@wenathlan/cadria 2.0.93 → 2.0.94
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// # familyurl.test — the family link resolver of the rail foot: the relative
|
|
2
|
+
// sibling path the window chrome builds for the other deploy units of the
|
|
3
|
+
// family, runnable with the node built-in runner (no dependencies, no
|
|
4
|
+
// install):
|
|
5
|
+
// node --test tests/familyurl.test.ts
|
|
6
|
+
// Every test watches the contract the rail promises: the url always climbs
|
|
7
|
+
// one level into the sibling folder, is slash-terminated, survives slugs
|
|
8
|
+
// that arrive decorated with slashes and answers for every member of the
|
|
9
|
+
// family.
|
|
10
|
+
import assert from "node:assert/strict";
|
|
11
|
+
import { describe, it } from "node:test";
|
|
12
|
+
import { familyurl } from "../familyurl.ts";
|
|
13
|
+
|
|
14
|
+
describe("familyurl", () => {
|
|
15
|
+
it("resolves a bare slug into the sibling folder", () => {
|
|
16
|
+
assert.equal(familyurl("devthink"), "../devthink/");
|
|
17
|
+
assert.equal(familyurl("stealthhead"), "../stealthhead/");
|
|
18
|
+
assert.equal(familyurl("debonair"), "../debonair/");
|
|
19
|
+
assert.equal(familyurl("getry"), "../getry/");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("strips decorative slashes from the slug", () => {
|
|
23
|
+
assert.equal(familyurl("/devthink"), "../devthink/");
|
|
24
|
+
assert.equal(familyurl("devthink/"), "../devthink/");
|
|
25
|
+
assert.equal(familyurl("/debonair/"), "../debonair/");
|
|
26
|
+
assert.equal(familyurl("//forge//"), "../forge/");
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it("keeps the relative form stable for every member of the family", () => {
|
|
30
|
+
for (const slug of ["devthink", "stealthhead", "debonair", "argan", "saddle", "forge", "foundry", "vault", "getry"]) {
|
|
31
|
+
const url = familyurl(slug);
|
|
32
|
+
assert.ok(url.startsWith("../"), `${url} must climb one deploy unit`);
|
|
33
|
+
assert.ok(url.endsWith("/"), `${url} must be slash-terminated`);
|
|
34
|
+
assert.equal(url, `../${slug}/`);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
});
|