bitcore-matrixpay-lib
Version:
A pure and powerful JavaScript MatrixPay library.
19 lines (15 loc) • 690 B
JavaScript
var should = require('chai').should();
var sinon = require('sinon');
var bitcore = require('../');
describe('#versionGuard', function() {
it('global._matrixpaycore should be defined', function() {
should.equal(global._matrixpaycore, bitcore.version);
});
it('throw a warning if version is already defined', function() {
sinon.stub(console, 'warn');
bitcore.versionGuard('version');
should.equal(console.warn.calledOnce,true);
should.equal(console.warn.calledWith('More than one instance of matrixpaycore-lib found. Please make sure that you are not mixing instances of classes of the different versions of matrixpaycore.'),true)
});
});
;