From 3d2b7b2a65787858c9471bc48cc5860c07b7f7dc Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 9 Jun 2021 15:26:18 +0200 Subject: formatting: re-run prettier --- packages/idb-bridge/src/backend-interface.ts | 2 +- packages/idb-bridge/src/idb-wpt-ported/README | 11 ++-- .../src/idb-wpt-ported/cursor-overloads.test.ts | 65 +++++++++++++--------- .../idb-bridge/src/idb-wpt-ported/value.test.ts | 4 +- packages/idb-bridge/src/index.ts | 2 +- 5 files changed, 49 insertions(+), 35 deletions(-) (limited to 'packages/idb-bridge') 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 + ): Promise; } 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 { return new Promise((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"; -- cgit v1.2.3