-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
28 lines (25 loc) · 784 Bytes
/
test.js
File metadata and controls
28 lines (25 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { test, suite } from "node:test";
import assert from "node:assert";
import scriptlets from "./index.js";
test("default export is an object", () => {
assert(typeof scriptlets === "object");
});
test("each scriptlet has basic properties", () => {
for (const [name, scriptlet] of Object.entries(scriptlets)) {
assert(name.length > 0, `${name} - name is too short`);
assert(
scriptlet.func instanceof Function,
`${name} - func is not have a Function`
);
assert(
scriptlet.aliases instanceof Array,
`${name} - aliases is not an Array`
);
}
});
suite("uBO", () => {
test("handles aliases", () => {
assert(scriptlets["set-constant.js"]);
assert.strictEqual(scriptlets["set-constant.js"], scriptlets["set.js"]);
});
});