From add890adf3630932060fc2c66dc3e252bc220618 Mon Sep 17 00:00:00 2001 From: Damian Mee Date: Thu, 21 Aug 2014 04:48:54 +0200 Subject: [PATCH] test(ticker): ticker call check added --- test/index.js | 9 +++++++++ test/mocks/ticker.js | 16 +++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/test/index.js b/test/index.js index a7935fd6..840e92b3 100644 --- a/test/index.js +++ b/test/index.js @@ -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); + }); + + }); + }); diff --git a/test/mocks/ticker.js b/test/mocks/ticker.js index 7c664a89..65addc3e 100644 --- a/test/mocks/ticker.js +++ b/test/mocks/ticker.js @@ -4,6 +4,20 @@ module.exports = { SUPPORTED_MODULES: [ 'ticker' ], NAME: 'Mock Ticker', + tickerCalls: 0, + 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); + } };