2018-08-07 09:57:11 +00:00
|
|
|
const fs = require('fs-extra');
|
2017-09-10 18:04:22 +00:00
|
|
|
process.on('warning', warning => {
|
|
|
|
console.log(warning.name);
|
|
|
|
console.log(warning.message);
|
|
|
|
console.log(warning.stack);
|
|
|
|
});
|
2017-09-08 12:37:55 +00:00
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
let verbose = false;
|
2017-09-08 12:37:55 +00:00
|
|
|
|
2018-12-20 16:05:30 +00:00
|
|
|
if (process.argv[2] === '--v')
|
2017-09-08 12:37:55 +00:00
|
|
|
verbose = true;
|
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
servicesDir = `${__dirname}/services`;
|
2018-03-13 10:15:39 +00:00
|
|
|
|
2018-12-19 07:42:07 +00:00
|
|
|
let Jasmine = require('jasmine');
|
|
|
|
let jasmine = new Jasmine();
|
|
|
|
let SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
2017-09-08 12:37:55 +00:00
|
|
|
|
2018-08-07 09:57:11 +00:00
|
|
|
let serviceList = fs.readdirSync(servicesDir);
|
|
|
|
let serviceSpecs = [
|
2018-08-09 13:00:33 +00:00
|
|
|
'auth/server/**/*[sS]pec.js',
|
|
|
|
'salix/server/**/*[sS]pec.js'
|
2018-08-07 09:57:11 +00:00
|
|
|
];
|
|
|
|
const exclude = ['auth', 'salix'];
|
|
|
|
|
|
|
|
for (let service of serviceList) {
|
|
|
|
try {
|
|
|
|
let serviceDir = fs.readdirSync(`${servicesDir}/${service}`);
|
|
|
|
for (let file of serviceDir) {
|
|
|
|
if (file === 'server' && exclude.indexOf(service) == -1)
|
|
|
|
serviceSpecs.push(`${service}/common/**/*[sS]pec.js`);
|
|
|
|
}
|
|
|
|
} catch (e) {}
|
|
|
|
}
|
|
|
|
|
2017-09-08 12:37:55 +00:00
|
|
|
jasmine.loadConfig({
|
2018-01-15 11:53:48 +00:00
|
|
|
spec_dir: 'services',
|
2018-08-07 09:57:11 +00:00
|
|
|
spec_files: serviceSpecs,
|
2018-12-20 16:05:30 +00:00
|
|
|
helpers: []
|
2017-09-08 12:37:55 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
jasmine.addReporter(new SpecReporter({
|
|
|
|
spec: {
|
|
|
|
// displayStacktrace: 'summary',
|
|
|
|
displaySuccessful: verbose,
|
|
|
|
displayFailedSpec: true,
|
|
|
|
displaySpecDuration: true
|
|
|
|
}
|
|
|
|
}));
|
|
|
|
|
2018-01-15 10:34:48 +00:00
|
|
|
jasmine.execute();
|