mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #1520 from eordano/style/fixtests
Fix tests: Allow single files to be run
This commit is contained in:
commit
57a2171b71
|
@ -88,12 +88,12 @@ module.exports = function(grunt) {
|
||||||
mochaTest: {
|
mochaTest: {
|
||||||
tests: {
|
tests: {
|
||||||
options: {
|
options: {
|
||||||
require: 'test/mocha_node_setup.js',
|
require: 'setup/node.js',
|
||||||
reporter: 'spec',
|
reporter: 'spec',
|
||||||
mocha: require('mocha')
|
mocha: require('mocha')
|
||||||
},
|
},
|
||||||
src: [
|
src: [
|
||||||
'test/models/*.js',
|
'test/*.js',
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -63,8 +63,8 @@ module.exports = function(config) {
|
||||||
'test/mocha.conf.js',
|
'test/mocha.conf.js',
|
||||||
|
|
||||||
//test files
|
//test files
|
||||||
'karma/setup.js',
|
'setup/karma.js',
|
||||||
'test/models/*.js',
|
'test/*.js',
|
||||||
|
|
||||||
'test/unit/**/*.js',
|
'test/unit/**/*.js',
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
global.chai = require('chai');
|
||||||
|
global.sinon = require('sinon');
|
||||||
|
global.bitcore = require('bitcore');
|
||||||
|
global.expect = global.chai.expect;
|
||||||
|
global.bignum = global.bitcore.Bignum;
|
||||||
|
global.should = global.chai.should();
|
||||||
|
|
||||||
|
global.copay = require('../copay');
|
||||||
|
global.copayConfig = require('../config');
|
||||||
|
|
||||||
|
global.requireMock = function(name) {
|
||||||
|
return require('../test/mocks/' + name);
|
||||||
|
}
|
||||||
|
|
||||||
|
global.is_browser = typeof process == 'undefined' || typeof process.versions === 'undefined';
|
||||||
|
global._ = require('underscore');
|
|
@ -1 +1 @@
|
||||||
--require test/mocha_node_setup.js --reporter spec test/models/*.js
|
--require setup/node.js --reporter spec
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
if (!!global) {
|
|
||||||
global.chai = require('chai');
|
|
||||||
global.sinon = require('sinon');
|
|
||||||
global.bitcore = require('bitcore');
|
|
||||||
global.expect = global.chai.expect;
|
|
||||||
global.bignum = global.bitcore.Bignum;
|
|
||||||
global.should = global.chai.should();
|
|
||||||
|
|
||||||
try {
|
|
||||||
global.copay = require('copay');
|
|
||||||
global.copayConfig = require('config');
|
|
||||||
} catch (e) {
|
|
||||||
global.copay = require('../copay');
|
|
||||||
global.copayConfig = require('../config');
|
|
||||||
}
|
|
||||||
|
|
||||||
global.requireMock = function(name) {
|
|
||||||
try {
|
|
||||||
return require('../mocks/' + name);
|
|
||||||
} catch (e) {
|
|
||||||
return require('./mocks/' + name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
global.is_browser = typeof process == 'undefined' || typeof process.versions === 'undefined';
|
|
||||||
global._ = require('underscore');
|
|
||||||
}
|
|
Loading…
Reference in New Issue