1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Add good stack traces tests and fix stack traces in debug mode

This commit is contained in:
Ruben Bridgewater
2016-06-01 14:04:25 +02:00
parent 579584d629
commit a41cfa9aae
4 changed files with 81 additions and 3 deletions

20
test/lib/good-traces.js Normal file
View File

@@ -0,0 +1,20 @@
// Spawned by the good_stacks.spec.js tests
'use strict';
var assert = require('assert');
var redis = require('../../index');
var client = redis.createClient();
// Both error cases would normally return bad stack traces
client.set('foo', function (err, res) {
assert(/good-traces.js:9:8/.test(err.stack));
client.set('foo', 'bar', function (err, res) {
assert(/good-traces.js:11:12/.test(err.stack));
client.quit(function () {
process.exit(0);
});
});
process.nextTick(function () {
client.stream.destroy();
});
});