Better name for test db

pull/2/head
Louis Chatriot 11 years ago
parent a725b962b6
commit f3001d9ba1
  1. 4
      test/persistence.test.js
  2. 2
      test_lac/loadAndCrash.test.js

@ -264,14 +264,14 @@ describe('Persistence', function () {
for (i = 0; i < N; i += 1) { for (i = 0; i < N; i += 1) {
toWrite += model.serialize({ _id: customUtils.uid(16), hello: 'world' }) + '\n'; toWrite += model.serialize({ _id: customUtils.uid(16), hello: 'world' }) + '\n';
} }
fs.writeFileSync('workspace/rah.db', toWrite, 'utf8'); fs.writeFileSync('workspace/lac.db', toWrite, 'utf8');
// Loading it in a separate process that'll crash before finishing the load // Loading it in a separate process that'll crash before finishing the load
cp = child_process.fork('test_lac/loadAndCrash.test') cp = child_process.fork('test_lac/loadAndCrash.test')
cp.on('message', function (msg) { cp.on('message', function (msg) {
// Let the child process enough time to crash // Let the child process enough time to crash
setTimeout(function () { setTimeout(function () {
fs.readFileSync('workspace/rah.db', 'utf8').length.should.not.equal(0); fs.readFileSync('workspace/lac.db', 'utf8').length.should.not.equal(0);
done(); done();
}, 100); }, 100);
}); });

@ -1,5 +1,5 @@
var Nedb = require('../lib/datastore.js') var Nedb = require('../lib/datastore.js')
, db = new Nedb({ filename: 'workspace/rah.db' }) , db = new Nedb({ filename: 'workspace/lac.db' })
; ;
// Simulate a crash in 100ms // Simulate a crash in 100ms

Loading…
Cancel
Save