2017-05-09 23:40:02 +00:00
|
|
|
'use strict';
|
|
|
|
|
2017-05-25 22:13:40 +00:00
|
|
|
require('./lib/exit-unless-test');
|
2017-05-27 12:24:08 +00:00
|
|
|
const mocha = require('./lib/mocha-e2e').mocha;
|
2017-05-23 02:15:32 +00:00
|
|
|
const path = require('path');
|
2017-05-09 23:40:02 +00:00
|
|
|
|
|
|
|
const only = 'only';
|
|
|
|
const skip = 'skip';
|
|
|
|
|
|
|
|
let tests = [
|
2018-01-28 22:59:05 +00:00
|
|
|
//'login',
|
2017-05-25 22:13:40 +00:00
|
|
|
'subscription'
|
2017-05-09 23:40:02 +00:00
|
|
|
];
|
|
|
|
|
2017-05-23 02:15:32 +00:00
|
|
|
tests = tests.map(testSpec => (testSpec.constructor === Array ? testSpec : [testSpec]));
|
|
|
|
tests = tests.filter(testSpec => testSpec[1] !== skip);
|
|
|
|
if (tests.some(testSpec => testSpec[1] === only)) {
|
|
|
|
tests = tests.filter(testSpec => testSpec[1] === only);
|
2017-05-09 23:40:02 +00:00
|
|
|
}
|
|
|
|
|
2017-05-23 02:15:32 +00:00
|
|
|
for (const testSpec of tests) {
|
|
|
|
const testPath = path.join(__dirname, 'tests', testSpec[0] + '.js');
|
|
|
|
mocha.addFile(testPath);
|
|
|
|
}
|
2017-05-09 23:40:02 +00:00
|
|
|
|
2017-05-23 02:15:32 +00:00
|
|
|
mocha.run(failures => {
|
|
|
|
process.exit(failures); // exit with non-zero status if there were failures
|
2017-05-09 23:40:02 +00:00
|
|
|
});
|