UNPKG

matrixbitcore-lib

Version:

A pure and powerful JavaScript MatrixBit library.

19 lines (15 loc) 690 B
'use strict'; var should = require('chai').should(); var sinon = require('sinon'); var bitcore = require('../'); describe('#versionGuard', function() { it('global._matrixbitcore should be defined', function() { should.equal(global._matrixbitcore, 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 matrixbitcore-lib found. Please make sure that you are not mixing instances of classes of the different versions of matrixbitcore.'),true) }); });