const fs = require('fs-extra'); process.on('warning', warning => { console.log(warning.name); console.log(warning.message); console.log(warning.stack); }); let verbose = false; if (process.argv[2] === '--v') verbose = true; servicesDir = `${__dirname}/services`; let Jasmine = require('jasmine'); let jasmine = new Jasmine(); let SpecReporter = require('jasmine-spec-reporter').SpecReporter; let serviceList = fs.readdirSync(servicesDir); let serviceSpecs = [ 'auth/server/**/*[sS]pec.js', 'salix/server/**/*[sS]pec.js' ]; 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) {} } jasmine.loadConfig({ spec_dir: 'services', spec_files: serviceSpecs, helpers: [ '/services/utils/jasmineHelpers.js' ] }); jasmine.addReporter(new SpecReporter({ spec: { // displayStacktrace: 'summary', displaySuccessful: verbose, displayFailedSpec: true, displaySpecDuration: true } })); jasmine.execute();