The JavaScript Database, for Node.js, nw.js, electron and the browser
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
nedb/browser-version/test/testPersistence.js

20 lines
589 B

console.log("Beginning tests");
console.log("Please note these tests work on Chrome latest, might not work on other browsers due to discrepancies in how local storage works for the file:// protocol");
function testsFailed () {
document.getElementById("results").innerHTML = "TESTS FAILED";
}
var filename = 'test';
var db = new Nedb({ filename: filename, autoload: true });
db.remove({}, { multi: true }, function () {
db.insert({ hello: 'world' }, function (err) {
if (err) {
testsFailed();
return;
}
window.location = './testPersistence2.html';
});
});