summaryrefslogtreecommitdiff
path: root/tests/sw.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/sw.js')
-rw-r--r--tests/sw.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/sw.js b/tests/sw.js
new file mode 100644
index 0000000..cff37bc
--- /dev/null
+++ b/tests/sw.js
@@ -0,0 +1,26 @@
+import {
+ leafValues,
+} from "../src/content/sw.exported.js";
+
+
+
+const test_leafValues = async t => {
+ t.start("leafValues()");
+
+ t.test("noop on empty object", () => {
+ t.assert.deepEqual(leafValues({}), []);
+ });
+
+ t.test("flat array for flat tree", () => {
+ });
+
+ t.test("array of empty arrays for leafless tree", () => {
+ t.assert.deepEqual(leafValues({ a: {} }), [[]]);
+ });
+};
+
+
+
+export const allTests = [
+ test_leafValues,
+];