summaryrefslogtreecommitdiff
path: root/packages/idb-bridge
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-06-09 15:26:18 +0200
committerFlorian Dold <florian@dold.me>2021-06-09 15:26:18 +0200
commit3d2b7b2a65787858c9471bc48cc5860c07b7f7dc (patch)
tree4a7477c184de7408104b8bf254a277a5949b19de /packages/idb-bridge
parent5c26461247040c07c86291babf0c87631df638b5 (diff)
downloadwallet-core-3d2b7b2a65787858c9471bc48cc5860c07b7f7dc.tar.gz
wallet-core-3d2b7b2a65787858c9471bc48cc5860c07b7f7dc.tar.bz2
wallet-core-3d2b7b2a65787858c9471bc48cc5860c07b7f7dc.zip
formatting: re-run prettier
Diffstat (limited to 'packages/idb-bridge')
-rw-r--r--packages/idb-bridge/src/backend-interface.ts2
-rw-r--r--packages/idb-bridge/src/idb-wpt-ported/README11
-rw-r--r--packages/idb-bridge/src/idb-wpt-ported/cursor-overloads.test.ts65
-rw-r--r--packages/idb-bridge/src/idb-wpt-ported/value.test.ts4
-rw-r--r--packages/idb-bridge/src/index.ts2
5 files changed, 49 insertions, 35 deletions
diff --git a/packages/idb-bridge/src/backend-interface.ts b/packages/idb-bridge/src/backend-interface.ts
index 5ca70c8a4..ae43c9df7 100644
--- a/packages/idb-bridge/src/backend-interface.ts
+++ b/packages/idb-bridge/src/backend-interface.ts
@@ -220,5 +220,5 @@ export interface Backend {
clearObjectStore(
btx: DatabaseTransaction,
objectStoreName: string,
- ): Promise<void>
+ ): Promise<void>;
}
diff --git a/packages/idb-bridge/src/idb-wpt-ported/README b/packages/idb-bridge/src/idb-wpt-ported/README
index 1947074d1..8efc8569a 100644
--- a/packages/idb-bridge/src/idb-wpt-ported/README
+++ b/packages/idb-bridge/src/idb-wpt-ported/README
@@ -3,11 +3,12 @@ This directory contains test cases from the W3C Web Platform Tests suite for Ind
The original code for these tests can be found here: https://github.com/web-platform-tests/wpt/tree/master/IndexedDB
The following tests are intentionally not included:
-* error-attributes.html (assumes we have a DOM)
-* file_support.sub.html (assumes we have a DOM)
-* fire-error-event-exception.html (ava can't test unhandled rejections)
-* fire-success-event-exception.html (ava can't test unhandled rejections)
-* fire-upgradeneeded-event-exception.html (ava can't test unhandled rejections)
+
+- error-attributes.html (assumes we have a DOM)
+- file_support.sub.html (assumes we have a DOM)
+- fire-error-event-exception.html (ava can't test unhandled rejections)
+- fire-success-event-exception.html (ava can't test unhandled rejections)
+- fire-upgradeneeded-event-exception.html (ava can't test unhandled rejections)
Test todo:
diff --git a/packages/idb-bridge/src/idb-wpt-ported/cursor-overloads.test.ts b/packages/idb-bridge/src/idb-wpt-ported/cursor-overloads.test.ts
index 0f0713d1d..c4bce8743 100644
--- a/packages/idb-bridge/src/idb-wpt-ported/cursor-overloads.test.ts
+++ b/packages/idb-bridge/src/idb-wpt-ported/cursor-overloads.test.ts
@@ -28,76 +28,85 @@ test.cb("WPT test cursor-overloads.htm", (t) => {
await checkCursorDirection(store.openCursor(), "next");
await checkCursorDirection(store.openCursor(0), "next");
- await checkCursorDirection(store.openCursor(0, 'next'), "next");
- await checkCursorDirection(store.openCursor(0, 'nextunique'), "nextunique");
- await checkCursorDirection(store.openCursor(0, 'prev'), "prev");
- await checkCursorDirection(store.openCursor(0, 'prevunique'), "prevunique");
+ await checkCursorDirection(store.openCursor(0, "next"), "next");
+ await checkCursorDirection(store.openCursor(0, "nextunique"), "nextunique");
+ await checkCursorDirection(store.openCursor(0, "prev"), "prev");
+ await checkCursorDirection(store.openCursor(0, "prevunique"), "prevunique");
await checkCursorDirection(store.openCursor(IDBKeyRange.only(0)), "next");
await checkCursorDirection(
- store.openCursor(BridgeIDBKeyRange.only(0), 'next'),
+ store.openCursor(BridgeIDBKeyRange.only(0), "next"),
"next",
);
await checkCursorDirection(
- store.openCursor(IDBKeyRange.only(0), 'nextunique'),
+ store.openCursor(IDBKeyRange.only(0), "nextunique"),
"nextunique",
);
await checkCursorDirection(
- store.openCursor(IDBKeyRange.only(0), 'prev'),
+ store.openCursor(IDBKeyRange.only(0), "prev"),
"prev",
);
await checkCursorDirection(
- store.openCursor(IDBKeyRange.only(0), 'prevunique'),
+ store.openCursor(IDBKeyRange.only(0), "prevunique"),
"prevunique",
);
await checkCursorDirection(index.openCursor(), "next");
await checkCursorDirection(index.openCursor(0), "next");
- await checkCursorDirection(index.openCursor(0, 'next'), "next");
- await checkCursorDirection(index.openCursor(0, 'nextunique'), "nextunique");
- await checkCursorDirection(index.openCursor(0, 'prev'), "prev");
- await checkCursorDirection(index.openCursor(0, 'prevunique'), "prevunique");
+ await checkCursorDirection(index.openCursor(0, "next"), "next");
+ await checkCursorDirection(index.openCursor(0, "nextunique"), "nextunique");
+ await checkCursorDirection(index.openCursor(0, "prev"), "prev");
+ await checkCursorDirection(index.openCursor(0, "prevunique"), "prevunique");
await checkCursorDirection(index.openCursor(IDBKeyRange.only(0)), "next");
await checkCursorDirection(
- index.openCursor(IDBKeyRange.only(0), 'next'),
+ index.openCursor(IDBKeyRange.only(0), "next"),
"next",
);
await checkCursorDirection(
- index.openCursor(IDBKeyRange.only(0), 'nextunique'),
+ index.openCursor(IDBKeyRange.only(0), "nextunique"),
"nextunique",
);
await checkCursorDirection(
- index.openCursor(IDBKeyRange.only(0), 'prev'),
+ index.openCursor(IDBKeyRange.only(0), "prev"),
"prev",
);
await checkCursorDirection(
- index.openCursor(IDBKeyRange.only(0), 'prevunique'),
+ index.openCursor(IDBKeyRange.only(0), "prevunique"),
"prevunique",
);
await checkCursorDirection(index.openKeyCursor(), "next");
await checkCursorDirection(index.openKeyCursor(0), "next");
- await checkCursorDirection(index.openKeyCursor(0, 'next'), "next");
- await checkCursorDirection(index.openKeyCursor(0, 'nextunique'), "nextunique");
- await checkCursorDirection(index.openKeyCursor(0, 'prev'), "prev");
- await checkCursorDirection(index.openKeyCursor(0, 'prevunique'), "prevunique");
+ await checkCursorDirection(index.openKeyCursor(0, "next"), "next");
+ await checkCursorDirection(
+ index.openKeyCursor(0, "nextunique"),
+ "nextunique",
+ );
+ await checkCursorDirection(index.openKeyCursor(0, "prev"), "prev");
+ await checkCursorDirection(
+ index.openKeyCursor(0, "prevunique"),
+ "prevunique",
+ );
- await checkCursorDirection(index.openKeyCursor(IDBKeyRange.only(0)), "next");
await checkCursorDirection(
- index.openKeyCursor(IDBKeyRange.only(0), 'next'),
+ index.openKeyCursor(IDBKeyRange.only(0)),
"next",
);
await checkCursorDirection(
- index.openKeyCursor(IDBKeyRange.only(0), 'nextunique'),
+ index.openKeyCursor(IDBKeyRange.only(0), "next"),
+ "next",
+ );
+ await checkCursorDirection(
+ index.openKeyCursor(IDBKeyRange.only(0), "nextunique"),
"nextunique",
);
await checkCursorDirection(
- index.openKeyCursor(IDBKeyRange.only(0), 'prev'),
+ index.openKeyCursor(IDBKeyRange.only(0), "prev"),
"prev",
);
await checkCursorDirection(
- index.openKeyCursor(IDBKeyRange.only(0), 'prevunique'),
+ index.openKeyCursor(IDBKeyRange.only(0), "prevunique"),
"prevunique",
);
@@ -110,7 +119,11 @@ test.cb("WPT test cursor-overloads.htm", (t) => {
): Promise<void> {
return new Promise<void>((resolve, reject) => {
request.onsuccess = function (event: any) {
- t.notDeepEqual(event.target.result, null, "Check the result is not null");
+ t.notDeepEqual(
+ event.target.result,
+ null,
+ "Check the result is not null",
+ );
t.deepEqual(
event.target.result.direction,
direction,
diff --git a/packages/idb-bridge/src/idb-wpt-ported/value.test.ts b/packages/idb-bridge/src/idb-wpt-ported/value.test.ts
index b1c2b3bee..acae2fe63 100644
--- a/packages/idb-bridge/src/idb-wpt-ported/value.test.ts
+++ b/packages/idb-bridge/src/idb-wpt-ported/value.test.ts
@@ -37,8 +37,8 @@ test.cb("WPT test value.htm, date", (t) => {
.transaction("store")
.objectStore("store")
.get(1).onsuccess = (e: any) => {
- console.log("target", e.target);
- console.log("result", e.target.result);
+ console.log("target", e.target);
+ console.log("result", e.target.result);
t.assert(e.target.result instanceof _instanceof, "instanceof");
t.end();
};
diff --git a/packages/idb-bridge/src/index.ts b/packages/idb-bridge/src/index.ts
index a0bd8b86d..fa9edaea6 100644
--- a/packages/idb-bridge/src/index.ts
+++ b/packages/idb-bridge/src/index.ts
@@ -116,4 +116,4 @@ export function shimIndexedDB(factory: BridgeIDBFactory): void {
export * from "./idbtypes";
-export * from "./util/structuredClone"; \ No newline at end of file
+export * from "./util/structuredClone";