better-sqlite3
Advanced tools
Comparing version 1.1.2 to 1.1.3
{ | ||
"name": "better-sqlite3", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "The fastest and simplest library for SQLite3 in Node.js.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/JoshuaWise/better-sqlite3", |
var expect = require('chai').expect; | ||
var fs = require('fs'); | ||
var Database = require('../.'); | ||
var util = require('../tools/test-util.js'); | ||
var util = (function () { | ||
var path = require('path'); | ||
var dbId = 0; | ||
var obj; | ||
return obj = { | ||
current: function () { | ||
return 'temp/' + path.basename(__filename).split('.')[0] + '.' + dbId + '.db'; | ||
}, | ||
next: function () {++dbId; return obj.current();} | ||
}; | ||
}()); | ||
@@ -6,0 +16,0 @@ describe('new Database()', function () { |
var expect = require('chai').expect; | ||
var Database = require('../.'); | ||
var util = require('../tools/test-util.js'); | ||
var util = (function () { | ||
var path = require('path'); | ||
var dbId = 0; | ||
var obj; | ||
return obj = { | ||
current: function () { | ||
return 'temp/' + path.basename(__filename).split('.')[0] + '.' + dbId + '.db'; | ||
}, | ||
next: function () {++dbId; return obj.current();} | ||
}; | ||
}()); | ||
@@ -5,0 +15,0 @@ describe('Database#close()', function () { |
var expect = require('chai').expect; | ||
var Database = require('../.'); | ||
var util = require('../tools/test-util.js'); | ||
var util = (function () { | ||
var path = require('path'); | ||
var dbId = 0; | ||
var obj; | ||
return obj = { | ||
current: function () { | ||
return 'temp/' + path.basename(__filename).split('.')[0] + '.' + dbId + '.db'; | ||
}, | ||
next: function () {++dbId; return obj.current();} | ||
}; | ||
}()); | ||
@@ -5,0 +15,0 @@ describe('Database#pragma()', function () { |
var expect = require('chai').expect; | ||
var Database = require('../.'); | ||
var util = require('../tools/test-util.js'); | ||
var util = (function () { | ||
var path = require('path'); | ||
var dbId = 0; | ||
var obj; | ||
return obj = { | ||
current: function () { | ||
return 'temp/' + path.basename(__filename).split('.')[0] + '.' + dbId + '.db'; | ||
}, | ||
next: function () {++dbId; return obj.current();} | ||
}; | ||
}()); | ||
@@ -5,0 +15,0 @@ describe('Database#prepare()', function () { |
var expect = require('chai').expect; | ||
var Database = require('../.'); | ||
var util = require('../tools/test-util.js'); | ||
var util = (function () { | ||
var path = require('path'); | ||
var dbId = 0; | ||
var obj; | ||
return obj = { | ||
current: function () { | ||
return 'temp/' + path.basename(__filename).split('.')[0] + '.' + dbId + '.db'; | ||
}, | ||
next: function () {++dbId; return obj.current();} | ||
}; | ||
}()); | ||
@@ -5,0 +15,0 @@ describe('Database#transaction()', function () { |
'use strict'; | ||
var expect = require('chai').expect; | ||
var Database = require('../.'); | ||
var util = require('../tools/test-util.js'); | ||
var db; | ||
before(function (done) { | ||
db = new Database(util.next()); | ||
db = new Database('temp/' + require('path').basename(__filename).split('.')[0] + '.db'); | ||
db.on('open', done); | ||
@@ -128,3 +127,11 @@ }); | ||
}).to.throw(Error); | ||
// This part of the test may fail is Statement#get() does not work. | ||
var i = 0; | ||
var row; | ||
while (row = db.prepare('SELECT * FROM entries WHERE rowid=' + ++i).get()) { | ||
expect(row).to.deep.equal({a: 'foo', b: 25, c: 25, d: Buffer.alloc(8).fill(0xdd)}) | ||
} | ||
expect(i).to.equal(9); | ||
}); | ||
}); |
var expect = require('chai').expect; | ||
var Database = require('../.'); | ||
var util = require('../tools/test-util.js'); | ||
@@ -5,0 +4,0 @@ describe('Database#checkpoint()', function () { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2622280
115
1569