You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-04 15:02:09 +03:00
Insert deprecation warnings and some minor refactoring
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
var assert = require('assert');
|
||||
var Queue = require('double-ended-queue');
|
||||
var utils = require('../lib/utils');
|
||||
var intercept = require('intercept-stdout');
|
||||
|
||||
describe('utils.js', function () {
|
||||
|
||||
@ -40,6 +41,30 @@ describe('utils.js', function () {
|
||||
});
|
||||
});
|
||||
|
||||
describe('print helper', function () {
|
||||
it('callback with reply', function () {
|
||||
var text = '';
|
||||
var unhookIntercept = intercept(function(data) {
|
||||
text += data;
|
||||
return '';
|
||||
});
|
||||
utils.print(null, 'abc');
|
||||
unhookIntercept();
|
||||
assert.strictEqual(text, 'Reply: abc\n');
|
||||
});
|
||||
|
||||
it('callback with error', function () {
|
||||
var text = '';
|
||||
var unhookIntercept = intercept(function(data) {
|
||||
text += data;
|
||||
return '';
|
||||
});
|
||||
utils.print(new Error('Wonderful exception'));
|
||||
unhookIntercept();
|
||||
assert.strictEqual(text, 'Error: Wonderful exception\n');
|
||||
});
|
||||
});
|
||||
|
||||
describe('reply_in_order', function () {
|
||||
|
||||
var err_count = 0;
|
||||
|
Reference in New Issue
Block a user