Commit 4267d542 by King Koopa

Replaced process.nextTick with setImmediate in profile.test

parent a21226a1
......@@ -36,8 +36,9 @@
"url": "git://github.com/mapbox/node-sqlite3.git"
},
"dependencies": {
"nan": "1.1.2",
"node-pre-gyp": "0.5.13",
"nan": "1.1.2"
"set-immediate": "0.1.1"
},
"bundledDependencies": [
"node-pre-gyp"
......
var sqlite3 = require('..');
var assert = require('assert');
require('set-immediate');
describe('profiling', function() {
var create = false;
......@@ -14,6 +15,7 @@ describe('profiling', function() {
if (sql.match(/^SELECT/)) {
assert.ok(!select);
assert.equal(sql, "SELECT * FROM foo");
console.log('profile select');
select = true;
}
else if (sql.match(/^CREATE/)) {
......@@ -31,7 +33,7 @@ describe('profiling', function() {
assert.ok(!create);
db.run("CREATE TABLE foo (id int)", function(err) {
if (err) throw err;
process.nextTick(function() {
setImmediate(function() {
assert.ok(create);
done();
});
......@@ -43,10 +45,10 @@ describe('profiling', function() {
assert.ok(!select);
db.run("SELECT * FROM foo", function(err) {
if (err) throw err;
process.nextTick(function() {
setImmediate(function() {
assert.ok(select);
done();
});
}, 0);
});
});
......
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