summaryrefslogtreecommitdiff
path: root/tests/js/db.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/js/db.mjs')
-rw-r--r--tests/js/db.mjs33
1 files changed, 1 insertions, 32 deletions
diff --git a/tests/js/db.mjs b/tests/js/db.mjs
index 372f64a..fcea535 100644
--- a/tests/js/db.mjs
+++ b/tests/js/db.mjs
@@ -3,39 +3,9 @@ import assert from "node:assert/strict";
import sqlite from "../../src/sqlite.cjs";
import { runTests } from "../runner.mjs";
-import { promisify, promisifyDb, open, db, init } from "../../src/db.mjs";
+import { promisifyDb, open, db, init } from "../../src/db.mjs";
-const test_promisify = t => {
- t.start("promisify()");
-
- t.test("we wrap the callbacky function", async () => {
- const okFn1 = (a, b, cb) =>
- setTimeout(() => cb(null, { a, b, ok: true }));
- const errFn1 = (a, b, c, cb) =>
- setTimeout(() => cb({ err: true, a }, "ignored"));
-
- const okFn2 = promisify(okFn1);
- const errFn2 = promisify(errFn1);
-
- assert.deepEqual(
- await okFn2("a-value", "b-value"),
- {
- a: "a-value",
- b: "b-value",
- ok: true,
- },
- );
-
- assert.rejects(
- async () => await errFn2("aa", "bb", "cc"),
- {
- err: true,
- a: "aa",
- },
- );
- });
-};
const test_promisifyDb = t => {
t.start("promisifyDb()");
@@ -128,7 +98,6 @@ const test_init = t => {
await runTests([
- test_promisify,
test_promisifyDb,
test_open,
test_init,