From d45cf0d708bc739b6478e741c964da2e64e3d874 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 21 Oct 2024 07:39:46 -0300 Subject: Init work on offline support and tests --- tests/sw.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/sw.js (limited to 'tests/sw.js') 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, +]; -- cgit v1.2.3