Commit 4267d542 by King Koopa

Replaced process.nextTick with setImmediate in profile.test

parent a21226a1
{
"name": "sqlite3",
"description": "Asynchronous, non-blocking SQLite3 bindings",
"version": "2.2.3",
"homepage": "http://github.com/mapbox/node-sqlite3",
"author": {
"name": "MapBox",
"url": "https://mapbox.com/"
},
"binary": {
"module_name": "node_sqlite3",
"module_path": "./lib/binding/{node_abi}-{platform}-{arch}",
"remote_path": "./{configuration}",
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz",
"host": "https://node-sqlite3.s3.amazonaws.com"
},
"contributors": [
"Konstantin Käfer <mail@kkaefer.com>",
"Dane Springmeyer <dane@mapbox.com>",
"Will White <will@mapbox.com>",
"Orlando Vazquez <ovazquez@gmail.com>",
"Artem Kustikov <kustikoff@gmail.com>",
"Eric Fredricksen <efredricksen@gmail.com>",
"John Wright <mrjjwright@gmail.com>",
"Ryan Dahl <ry@tinyclouds.org>",
"Tom MacWright <tom@mapbox.com>",
"Carter Thaxton <carter.thaxton@gmail.com>",
"Audrius Kažukauskas <audrius@neutrino.lt>",
"Johannes Schauer <josch@pyneo.org>",
"Nathan Rajlich <nathan@tootallnate.net>",
"AJ ONeal <coolaj86@gmail.com>",
"Mithgol"
],
"repository": {
"type": "git",
"url": "git://github.com/mapbox/node-sqlite3.git"
},
"dependencies": {
"node-pre-gyp": "0.5.13",
"nan": "1.1.2"
},
"bundledDependencies": [
"node-pre-gyp"
],
"devDependencies": {
"mocha": "*"
},
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"install": "node-pre-gyp install --fallback-to-build",
"pretest": "node test/support/createdb.js",
"test": "mocha -R spec --timeout 200000 -s 20000"
},
"licenses": [
{
"type": "BSD"
}
],
"main": "./lib/sqlite3"
"name": "sqlite3",
"description": "Asynchronous, non-blocking SQLite3 bindings",
"version": "2.2.3",
"homepage": "http://github.com/mapbox/node-sqlite3",
"author": {
"name": "MapBox",
"url": "https://mapbox.com/"
},
"binary": {
"module_name": "node_sqlite3",
"module_path": "./lib/binding/{node_abi}-{platform}-{arch}",
"remote_path": "./{configuration}",
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz",
"host": "https://node-sqlite3.s3.amazonaws.com"
},
"contributors": [
"Konstantin Käfer <mail@kkaefer.com>",
"Dane Springmeyer <dane@mapbox.com>",
"Will White <will@mapbox.com>",
"Orlando Vazquez <ovazquez@gmail.com>",
"Artem Kustikov <kustikoff@gmail.com>",
"Eric Fredricksen <efredricksen@gmail.com>",
"John Wright <mrjjwright@gmail.com>",
"Ryan Dahl <ry@tinyclouds.org>",
"Tom MacWright <tom@mapbox.com>",
"Carter Thaxton <carter.thaxton@gmail.com>",
"Audrius Kažukauskas <audrius@neutrino.lt>",
"Johannes Schauer <josch@pyneo.org>",
"Nathan Rajlich <nathan@tootallnate.net>",
"AJ ONeal <coolaj86@gmail.com>",
"Mithgol"
],
"repository": {
"type": "git",
"url": "git://github.com/mapbox/node-sqlite3.git"
},
"dependencies": {
"nan": "1.1.2",
"node-pre-gyp": "0.5.13",
"set-immediate": "0.1.1"
},
"bundledDependencies": [
"node-pre-gyp"
],
"devDependencies": {
"mocha": "*"
},
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"install": "node-pre-gyp install --fallback-to-build",
"pretest": "node test/support/createdb.js",
"test": "mocha -R spec --timeout 200000 -s 20000"
},
"licenses": [
{
"type": "BSD"
}
],
"main": "./lib/sqlite3"
}
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