diff --git a/.gitignore b/.gitignore index 3c3629e..0255e0a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules +node_modules/ +test/config.js diff --git a/test/api.js b/test/api.js index 06cc548..8b84d0f 100644 --- a/test/api.js +++ b/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); - - diff --git a/test/config.example.js b/test/config.example.js new file mode 100644 index 0000000..43558d0 --- /dev/null +++ b/test/config.example.js @@ -0,0 +1,6 @@ +module.exports = { + host: 'localhost', + port: 8332, + user: 'jb55', + pass: 'thisisthepassword' +};