bitcoin errors should pass err object in callback
This commit is contained in:
parent
53d0381984
commit
79ab65759a
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,2 @@
|
||||
node_modules
|
||||
node_modules/
|
||||
test/config.js
|
||||
|
||||
25
test/api.js
25
test/api.js
@ -6,12 +6,7 @@ var test = {
|
||||
account: "test"
|
||||
};
|
||||
|
||||
var config = {
|
||||
host: 'localhost',
|
||||
port: 8332,
|
||||
user: 'jb55',
|
||||
pass: 'thisisthepassword'
|
||||
};
|
||||
var config = require('./config');
|
||||
|
||||
// end test variables
|
||||
|
||||
@ -143,9 +138,19 @@ vows.describe('api').addBatch({
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"creating a bitcoin related error": {
|
||||
topic: function(client) {
|
||||
client.cmd('nomethod', this.callback);
|
||||
},
|
||||
"should create non-null err in callback": function(err, expectedValue) {
|
||||
assert.deepEqual(err, {
|
||||
code: -32601,
|
||||
message: 'Method not found'
|
||||
});
|
||||
assert.equal(expectedValue, undefined);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
}).export(module);
|
||||
|
||||
|
||||
|
||||
6
test/config.example.js
Normal file
6
test/config.example.js
Normal file
@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
host: 'localhost',
|
||||
port: 8332,
|
||||
user: 'jb55',
|
||||
pass: 'thisisthepassword'
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user