Doesn't seem to work with the standard IndexedDB (at least in FF22/Nightly)
Closed this issue · 6 comments
When trying http://blog.superfeedr.com/indexeddb-backbonejs-adapter/tests.html with <script>
elements updated to the latest scripts from this repo (master branch) I get error
Timestamp: 10/03/13 00:27:31
Error: TypeError: db.createObjectStore is not a function
Source File: http://localhost:8000/tests.html
Line: 26
Odd, I just tried from Firefox and it works just fine.
However, I did not use the github hosted html, I checked out the repo and
open the file tests/test.html.
Mind trying that?
On Sun, Mar 10, 2013 at 12:39 AM, Matěj Cepl notifications@github.comwrote:
When trying
<script> elements updated to the latest scripts from this repo (master branch) I get error Timestamp: 10/03/13 00:27:31 Error: TypeError: db.createObjectStore is not a function Source File: http://localhost:8000/tests.html Line: 26 — Reply to this email directly or view it on GitHubhttps://github.com//issues/35 .
http://blog.superfeedr.com/indexeddb-backbonejs-adapter/tests.html with
Hmm, sorry ... this way it almost works. No errors, but two fails:
create duplicate models (1, 1, 2)Rerun270 ms
ConstraintError
Source:
file:///home/matej/projekty/elasmotherium/www/js/lib/backbone-indexeddb/backbone-indexeddb.js:271
global failure (1, 0, 1)Rerun1 ms
Error: assertion outside test context, was tests</<.success/<.success/<.success@file:///home/matej/projekty/elasmotherium/www/js/lib/backbone-indexeddb/tests/test.html:735 .save/c.success@file:///home/matej/projekty/elasmotherium/www/js/lib/backbone-indexeddb/lib/backbone-min.js:16 sync/options.success@file:///home/matej/projekty/elasmotherium/www/js/lib/backbone-indexeddb/backbone-indexeddb.js:574 Driver.prototype.update/writeTransaction.oncomplete@file:///home/matej/projekty/elasmotherium/www/js/lib/backbone-indexeddb/backbone-indexeddb.js:296
Source:
file:///home/matej/projekty/elasmotherium/www/js/lib/backbone-indexeddb/lib/qunit.js:899
Feel free to look into the code and submit a patch. I'll too busy this
days/weeks (until April 23rd)
so I won't have much time to look into this.
Thanks,
On Mon, Mar 11, 2013 at 2:01 PM, Matěj Cepl notifications@github.comwrote:
Hmm, sorry ... this way it almost works. No errors, but two fails:
create duplicate models (1, 1, 2)Rerun270 ms
ConstraintError Source: file:///home/matej/projekty/elasmotherium/www/js/lib/backbone-indexeddb/backbone-indexeddb.js:271
global failure (1, 0, 1)Rerun1 ms
Error: assertion outside test context, was tests</<.success/<.success/<.success@file:///home/matej/projekty/elasmotherium/www/js/lib/backbone-indexeddb/tests/test.html:735 .save/c.success@file:///home/matej/projekty/elasmotherium/www/js/lib/backbone-indexeddb/lib/backbone-min.js:16 sync/options.success@file:///home/matej/projekty/elasmotherium/www/js/lib/backbone-indexeddb/backbone-indexeddb.js:574 Driver.prototype.update/writeTransaction.oncomplete@file:///home/matej/projekty/elasmotherium/www/js/lib/backbone-indexeddb/backbone-indexeddb.js:296 Source: file:///home/matej/projekty/elasmotherium/www/js/lib/backbone-indexeddb/lib/qunit.js:899
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/35#issuecomment-14711871
.
Interestingly, if I load over http from my local machine in Firefox 22, the first two tests (create model v1, global failiure) are loaded and never complete, create model v1 having hung.
If, however, I load from the filesystem, 45 tests are run, and then the second create duplicate models fails:
create duplicate models (1, 1, 2)
The dupe should been refused.
ConstraintError
Source:
file:///Users/dmose/r/tools/indexeddb-backbonejs-adapter/backbone-indexeddb.js:263
Furthermore, loading over http in the (not yet released) Firefox 24, 25, and 26 all behave identically, which is to say that there is no hang, all the tests are run, and the duplicate models test fails.
Possibly interesting: in the web developer console in Firefox 22 loaded over the file: scheme, I see:
[14:25:19.073] syntax error @ file:///Users/dmose/r/tools/indexeddb-backbonejs-adapter/tests/mockAjax.json:1
No news in 7 months. Closing!
BTW, both http://blog.superfeedr.com/indexeddb-backbonejs-adapter/tests.html (linked from http://blog.superfeedr.com/backbonejs-indexeddb/ which is not what you have as a link on https://github.com/superfeedr/indexeddb-backbonejs-adapter ) and http://blog.superfeedr.com/backbonejs-indexeddb/tests.html (derived by an intuition) and also http://blog.superfeedr.com/backbonejs-indexeddb/test.html are broken, so there is no apparent way how to run those tests.