diff options
Diffstat (limited to 'packages/idb-bridge/src/idb-wpt-ported')
-rw-r--r-- | packages/idb-bridge/src/idb-wpt-ported/README | 11 | ||||
-rw-r--r-- | packages/idb-bridge/src/idb-wpt-ported/cursor-overloads.test.ts | 65 | ||||
-rw-r--r-- | packages/idb-bridge/src/idb-wpt-ported/value.test.ts | 4 |
3 files changed, 47 insertions, 33 deletions
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(); }; |