diff options
author | Florian Dold <florian@dold.me> | 2021-02-24 17:33:07 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-02-24 17:33:07 +0100 |
commit | 564e4f8710388ab2ae40c959c497f2e0260199ed (patch) | |
tree | 1d9f1b835bf6580977158f5eee133f8fa39f67d4 /packages/idb-bridge/src/idb-wpt-ported/idbindex-openCursor.test.ts | |
parent | bc7956c2ba685e459c94204ca30f85eef881d0ac (diff) | |
download | wallet-core-564e4f8710388ab2ae40c959c497f2e0260199ed.tar.xz |
idb: encapsulate non-JSON data correctly
Diffstat (limited to 'packages/idb-bridge/src/idb-wpt-ported/idbindex-openCursor.test.ts')
-rw-r--r-- | packages/idb-bridge/src/idb-wpt-ported/idbindex-openCursor.test.ts | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/packages/idb-bridge/src/idb-wpt-ported/idbindex-openCursor.test.ts b/packages/idb-bridge/src/idb-wpt-ported/idbindex-openCursor.test.ts index 2dcab6034..f4515b69e 100644 --- a/packages/idb-bridge/src/idb-wpt-ported/idbindex-openCursor.test.ts +++ b/packages/idb-bridge/src/idb-wpt-ported/idbindex-openCursor.test.ts @@ -56,25 +56,27 @@ test.cb("WPT test idbindex-openCursor2.htm", (t) => { }; }); - // IDBIndex.openCursor() - throw InvalidStateError on index deleted by aborted upgrade test.cb("WPT test idbindex-openCursor3.htm", (t) => { var db; -var open_rq = createdb(t); -open_rq.onupgradeneeded = function(e: any) { - db = e.target.result; - var store = db.createObjectStore("store", { keyPath: "key" }); - var index = store.createIndex("index", "indexedProperty"); - store.add({ key: 1, indexedProperty: "data" }); + var open_rq = createdb(t); + open_rq.onupgradeneeded = function (e: any) { + db = e.target.result; + var store = db.createObjectStore("store", { keyPath: "key" }); + var index = store.createIndex("index", "indexedProperty"); + store.add({ key: 1, indexedProperty: "data" }); - e.target.transaction.abort(); + e.target.transaction.abort(); - t.throws(() => { - console.log("index before openCursor", index); - index.openCursor(); - }, { name: "InvalidStateError"}); + t.throws( + () => { + console.log("index before openCursor", index); + index.openCursor(); + }, + { name: "InvalidStateError" }, + ); - t.end(); -} + t.end(); + }; }); |