salix/back/tests.js

45 lines
953 B
JavaScript
Raw Normal View History

2018-12-21 11:50:28 +00:00
require('require-yaml');
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;
2019-01-04 12:32:04 +00:00
serviceRoot = `${__dirname}/../loopback`;
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 serviceSpecs = [
2019-01-04 12:32:04 +00:00
'./loopback/**/*[sS]pec.js',
'./back/**/*[sS]pec.js'
2018-08-07 09:57:11 +00:00
];
2018-12-21 11:50:28 +00:00
2019-01-04 12:32:04 +00:00
let services = require(`../modules.yml`);
2018-12-27 11:54:16 +00:00
for (let service of services)
2019-01-04 12:32:04 +00:00
serviceSpecs.push(`./modules/${service}/back/**/*[sS]pec.js`);
2018-08-07 09:57:11 +00:00
2017-09-08 12:37:55 +00:00
jasmine.loadConfig({
spec_dir: '.',
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
}
}));
jasmine.execute();