Commit 4267d542 by King Koopa

Replaced process.nextTick with setImmediate in profile.test

parent a21226a1
{ {
"name": "sqlite3", "name": "sqlite3",
"description": "Asynchronous, non-blocking SQLite3 bindings", "description": "Asynchronous, non-blocking SQLite3 bindings",
"version": "2.2.3", "version": "2.2.3",
"homepage": "http://github.com/mapbox/node-sqlite3", "homepage": "http://github.com/mapbox/node-sqlite3",
"author": { "author": {
"name": "MapBox", "name": "MapBox",
"url": "https://mapbox.com/" "url": "https://mapbox.com/"
}, },
"binary": { "binary": {
"module_name": "node_sqlite3", "module_name": "node_sqlite3",
"module_path": "./lib/binding/{node_abi}-{platform}-{arch}", "module_path": "./lib/binding/{node_abi}-{platform}-{arch}",
"remote_path": "./{configuration}", "remote_path": "./{configuration}",
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz", "package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz",
"host": "https://node-sqlite3.s3.amazonaws.com" "host": "https://node-sqlite3.s3.amazonaws.com"
}, },
"contributors": [ "contributors": [
"Konstantin Käfer <mail@kkaefer.com>", "Konstantin Käfer <mail@kkaefer.com>",
"Dane Springmeyer <dane@mapbox.com>", "Dane Springmeyer <dane@mapbox.com>",
"Will White <will@mapbox.com>", "Will White <will@mapbox.com>",
"Orlando Vazquez <ovazquez@gmail.com>", "Orlando Vazquez <ovazquez@gmail.com>",
"Artem Kustikov <kustikoff@gmail.com>", "Artem Kustikov <kustikoff@gmail.com>",
"Eric Fredricksen <efredricksen@gmail.com>", "Eric Fredricksen <efredricksen@gmail.com>",
"John Wright <mrjjwright@gmail.com>", "John Wright <mrjjwright@gmail.com>",
"Ryan Dahl <ry@tinyclouds.org>", "Ryan Dahl <ry@tinyclouds.org>",
"Tom MacWright <tom@mapbox.com>", "Tom MacWright <tom@mapbox.com>",
"Carter Thaxton <carter.thaxton@gmail.com>", "Carter Thaxton <carter.thaxton@gmail.com>",
"Audrius Kažukauskas <audrius@neutrino.lt>", "Audrius Kažukauskas <audrius@neutrino.lt>",
"Johannes Schauer <josch@pyneo.org>", "Johannes Schauer <josch@pyneo.org>",
"Nathan Rajlich <nathan@tootallnate.net>", "Nathan Rajlich <nathan@tootallnate.net>",
"AJ ONeal <coolaj86@gmail.com>", "AJ ONeal <coolaj86@gmail.com>",
"Mithgol" "Mithgol"
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git://github.com/mapbox/node-sqlite3.git" "url": "git://github.com/mapbox/node-sqlite3.git"
}, },
"dependencies": { "dependencies": {
"node-pre-gyp": "0.5.13", "nan": "1.1.2",
"nan": "1.1.2" "node-pre-gyp": "0.5.13",
}, "set-immediate": "0.1.1"
"bundledDependencies": [ },
"node-pre-gyp" "bundledDependencies": [
], "node-pre-gyp"
"devDependencies": { ],
"mocha": "*" "devDependencies": {
}, "mocha": "*"
"engines": { },
"node": ">= 0.8.0" "engines": {
}, "node": ">= 0.8.0"
"scripts": { },
"install": "node-pre-gyp install --fallback-to-build", "scripts": {
"pretest": "node test/support/createdb.js", "install": "node-pre-gyp install --fallback-to-build",
"test": "mocha -R spec --timeout 200000 -s 20000" "pretest": "node test/support/createdb.js",
}, "test": "mocha -R spec --timeout 200000 -s 20000"
"licenses": [ },
{ "licenses": [
"type": "BSD" {
} "type": "BSD"
], }
"main": "./lib/sqlite3" ],
"main": "./lib/sqlite3"
} }
var sqlite3 = require('..'); var sqlite3 = require('..');
var assert = require('assert'); var assert = require('assert');
require('set-immediate');
describe('profiling', function() { describe('profiling', function() {
var create = false; var create = false;
...@@ -14,6 +15,7 @@ describe('profiling', function() { ...@@ -14,6 +15,7 @@ describe('profiling', function() {
if (sql.match(/^SELECT/)) { if (sql.match(/^SELECT/)) {
assert.ok(!select); assert.ok(!select);
assert.equal(sql, "SELECT * FROM foo"); assert.equal(sql, "SELECT * FROM foo");
console.log('profile select');
select = true; select = true;
} }
else if (sql.match(/^CREATE/)) { else if (sql.match(/^CREATE/)) {
...@@ -31,7 +33,7 @@ describe('profiling', function() { ...@@ -31,7 +33,7 @@ describe('profiling', function() {
assert.ok(!create); assert.ok(!create);
db.run("CREATE TABLE foo (id int)", function(err) { db.run("CREATE TABLE foo (id int)", function(err) {
if (err) throw err; if (err) throw err;
process.nextTick(function() { setImmediate(function() {
assert.ok(create); assert.ok(create);
done(); done();
}); });
...@@ -43,10 +45,10 @@ describe('profiling', function() { ...@@ -43,10 +45,10 @@ describe('profiling', function() {
assert.ok(!select); assert.ok(!select);
db.run("SELECT * FROM foo", function(err) { db.run("SELECT * FROM foo", function(err) {
if (err) throw err; if (err) throw err;
process.nextTick(function() { setImmediate(function() {
assert.ok(select); assert.ok(select);
done(); 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