Skip to content

Commit

Permalink
Merge pull request #1 from gauntface/patch-1
Browse files Browse the repository at this point in the history
Update mock.js
  • Loading branch information
philipwalton authored Dec 16, 2017
2 parents 14d7864 + 73ac26d commit 594ec7f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@ const storage = {}; // Root storage.
Object.defineProperty(this, 'version', { value: version, enumerable: true });
Object.defineProperty(this, 'objectStoreNames', {
enumerable: true,
get() { const names = Object.keys(data); names.sort(); return names; },
get() {
const names = Object.keys(data);
names.sort();
// Fake contains from DOMStringList
names.contains = (valueTest) => names.indexOf(valueTest) !== -1;
return names;
},
set() { throw new Error('IDBDatabase: _data is read only'); }
});
Object.defineProperty(this, '_data', {
Expand Down

0 comments on commit 594ec7f

Please sign in to comment.