One more test and recreate browser version

pull/2/head
Louis Chatriot 11 years ago
parent de1fccede9
commit 6cc64b10b9
  1. 3
      browser-version/out/nedb.js
  2. 4
      browser-version/out/nedb.min.js
  3. 2
      package.json
  4. 4
      test/db.test.js

@ -561,8 +561,7 @@ process.nextTick = (function () {
if (canPost) { if (canPost) {
var queue = []; var queue = [];
window.addEventListener('message', function (ev) { window.addEventListener('message', function (ev) {
var source = ev.source; if (ev.source === window && ev.data === 'process-tick') {
if ((source === window || source === null) && ev.data === 'process-tick') {
ev.stopPropagation(); ev.stopPropagation();
if (queue.length > 0) { if (queue.length > 0) {
var fn = queue.shift(); var fn = queue.shift();

File diff suppressed because one or more lines are too long

@ -34,7 +34,7 @@
"commander": "1.1.1" "commander": "1.1.1"
}, },
"scripts": { "scripts": {
"test": "./node_modules/.bin/mocha --reporter spec --timeout 2000" "test": "./node_modules/.bin/mocha --reporter spec --timeout 10000"
}, },
"browser": { "browser": {
"./lib/customUtils.js": "./browser-version/browser-specific/lib/customUtils.js", "./lib/customUtils.js": "./browser-version/browser-specific/lib/customUtils.js",

@ -205,9 +205,13 @@ describe('Database', function () {
newDoc.stuff.should.equal(true); newDoc.stuff.should.equal(true);
newDoc._id.should.equal('test'); newDoc._id.should.equal('test');
d.insert({ _id: 'test', otherstuff: 42 }, function (err) {
err.errorType.should.equal('uniqueViolated');
done(); done();
}); });
}); });
});
it('Modifying the insertedDoc after an insert doesnt change the copy saved in the database', function (done) { it('Modifying the insertedDoc after an insert doesnt change the copy saved in the database', function (done) {
d.insert({ a: 2, hello: 'world' }, function (err, newDoc) { d.insert({ a: 2, hello: 'world' }, function (err, newDoc) {

Loading…
Cancel
Save