test(ticker): ticker call check added
This commit is contained in:
parent
edffd2f595
commit
add890adf3
2 changed files with 24 additions and 1 deletions
|
|
@ -122,6 +122,15 @@ describe('Plugins', function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.timeout(9000);
|
||||||
|
|
||||||
|
describe('Ticker', function() {
|
||||||
|
it('should have .ticker() called at least once', function() {
|
||||||
|
tickerMock.tickerCalls.should.be.at.least(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,20 @@ module.exports = {
|
||||||
SUPPORTED_MODULES: [ 'ticker' ],
|
SUPPORTED_MODULES: [ 'ticker' ],
|
||||||
NAME: 'Mock Ticker',
|
NAME: 'Mock Ticker',
|
||||||
|
|
||||||
|
tickerCalls: 0,
|
||||||
|
|
||||||
config: function() {},
|
config: function() {},
|
||||||
ticker: function() {}
|
ticker: function(currency, callback) {
|
||||||
|
this.tickerCalls++;
|
||||||
|
|
||||||
|
var out = {};
|
||||||
|
out[currency] = {
|
||||||
|
currency: currency,
|
||||||
|
rates: {
|
||||||
|
ask: 1001.0,
|
||||||
|
bid: 999.0
|
||||||
|
}
|
||||||
|
};
|
||||||
|
callback(null, out);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue