Fee service unit test
This commit is contained in:
parent
f7da83693e
commit
7af2548d68
@ -10,7 +10,7 @@ var FeeService = function(options) {
|
||||
pass: 'local321',
|
||||
host: 'localhost',
|
||||
protocol: 'http',
|
||||
port: 8333
|
||||
port: 8332
|
||||
};
|
||||
BaseService.call(this, options);
|
||||
|
||||
|
||||
47
test/services/fee/index.unit.js
Normal file
47
test/services/fee/index.unit.js
Normal file
@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
|
||||
var sinon = require('sinon');
|
||||
var FeeService = require('../../../lib/services/fee');
|
||||
|
||||
var expect = require('chai').expect;
|
||||
|
||||
describe.only('#Fee Service', function() {
|
||||
var feeService;
|
||||
var sandbox;
|
||||
beforeEach(function() {
|
||||
sandbox = sinon.sandbox.create();
|
||||
feeService = new FeeService({
|
||||
"rpc": {
|
||||
"user": "bitcoin",
|
||||
"pass": "local321",
|
||||
"host": "localhost",
|
||||
"protocol": "http",
|
||||
"port": 8332
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(function() {
|
||||
sandbox.restore();
|
||||
});
|
||||
|
||||
/*
|
||||
Running in regtest mode or unsync'd will return -1
|
||||
*/
|
||||
|
||||
it("Has an estimateFee method", function() {
|
||||
var method = feeService.getAPIMethods()[0][0];
|
||||
expect(method).to.equal('estimateFee');
|
||||
})
|
||||
|
||||
it("Can estimate fees", function(done) {
|
||||
feeService.estimateFee(4, function(err, fee) {
|
||||
expect(err).to.be.a('null');
|
||||
expect(fee.result).to.exist;
|
||||
expect(fee.result).to.be.at.least(-1);
|
||||
done();
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user