Commit b91dc0b7 authored by Aral Balkan's avatar Aral Balkan

New tests. Rename clear script to clean

parent c875cf15
node_modules
*.sqlite
*.sqlite*
bundle.js
......@@ -42,16 +42,24 @@ async function start () {
})
const numInserts = 10000
const inserts = []
const inserts = []
for (let i = 0; i < numInserts; i++) {
inserts.push({ date: new Date(), description: `Item: ${i}`, done: Math.round(Math.random()) })
}
try {
// N inserts (bulk)
resetTimer()
await db.tasks.bulkPut(inserts)
displayDurationFor(`${numInserts} inserts (bulk)`)
// N inserts
let insertPromises = []
for (let i = 0; i < numInserts; i++) {
insertPromises.push(db.tasks.put({ date: new Date(), description: `Item: ${i}`, done: Math.round(Math.random()) }))
}
resetTimer()
await db.tasks.bulkPut(inserts)
await Promise.all(insertPromises)
displayDurationFor(`${numInserts} inserts`)
// Insert after N inserts
......
......@@ -7,5 +7,7 @@
"dexie": "^2.0.3",
"indexeddbshim": "^3.6.2"
},
"devDependencies": {}
"devDependencies": {
"standard": "^11.0.1"
}
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment