diff --git a/db_tests.js b/db_tests.js index 9581d46ff..6cc01e179 100644 --- a/db_tests.js +++ b/db_tests.js @@ -22,9 +22,7 @@ let serviceSpecs = [ jasmine.loadConfig({ spec_dir: 'services', spec_files: serviceSpecs, - helpers: [ - '/services/utils/jasmineHelpers.js' - ] + helpers: [] }); jasmine.addReporter(new SpecReporter({ diff --git a/e2e_tests.js b/e2e_tests.js index 3d4982ec3..1b35bb8b2 100644 --- a/e2e_tests.js +++ b/e2e_tests.js @@ -22,9 +22,7 @@ jasmine.loadConfig({ './e2e/**/*[sS]pec.js', './e2e/helpers/extensions.js' ], - helpers: [ - '/services/utils/jasmineHelpers.js' - ] + helpers: [] }); jasmine.addReporter(new SpecReporter({ diff --git a/services/loopback/common/methods/client/specs/hasCustomerRole.spec.js b/services/loopback/common/methods/client/specs/hasCustomerRole.spec.js index fc6e61152..a4212332a 100644 --- a/services/loopback/common/methods/client/specs/hasCustomerRole.spec.js +++ b/services/loopback/common/methods/client/specs/hasCustomerRole.spec.js @@ -1,5 +1,4 @@ const app = require(`${servicesDir}/client/server/server`); -const catchErrors = require(`${servicesDir}/utils/jasmineHelpers`).catchErrors; describe('Client hasCustomerRole', () => { it('should call the hasCustomerRole() method with a customer id', done => { @@ -7,7 +6,7 @@ describe('Client hasCustomerRole', () => { let params = {}; let callback = (error, result) => { - if (error) return catchErrors(done)(error); + if (error) return done.fail(error); expect(result).toEqual(jasmine.objectContaining({isCustomer: 1})); done(); @@ -21,7 +20,7 @@ describe('Client hasCustomerRole', () => { let params = {}; let callback = (error, result) => { - if (error) return catchErrors(done)(error); + if (error) return done.fail(error); expect(result).toEqual(jasmine.objectContaining({isCustomer: 0})); done(); @@ -35,7 +34,7 @@ describe('Client hasCustomerRole', () => { let params = {}; let callback = (error, result) => { - if (error) return catchErrors(done)(error); + if (error) return done.fail(error); expect(result).toEqual(jasmine.objectContaining({isCustomer: 0})); done(); @@ -49,7 +48,7 @@ describe('Client hasCustomerRole', () => { let params = {}; let callback = (error, result) => { - if (error) return catchErrors(done)(error); + if (error) return done.fail(error); expect(result).toEqual(jasmine.objectContaining({isCustomer: 0})); done(); diff --git a/services/loopback/common/methods/client/specs/listWorkers.spec.js b/services/loopback/common/methods/client/specs/listWorkers.spec.js index c9987ade1..66d6612eb 100644 --- a/services/loopback/common/methods/client/specs/listWorkers.spec.js +++ b/services/loopback/common/methods/client/specs/listWorkers.spec.js @@ -1,5 +1,4 @@ const app = require(`${servicesDir}/client/server/server`); -const catchErrors = require(`${servicesDir}/utils/jasmineHelpers`).catchErrors; describe('Client listWorkers', () => { it('should call the listWorkers()', done => { @@ -10,6 +9,6 @@ describe('Client listWorkers', () => { expect(amountOfEmployees).toEqual(41); done(); }) - .catch(catchErrors(done)); + .catch(done.fail); }); }); diff --git a/services/utils/jasmineHelpers.js b/services/utils/jasmineHelpers.js deleted file mode 100644 index fd0b82c5a..000000000 --- a/services/utils/jasmineHelpers.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports.catchErrors = function(done) { - return error => { - if (error instanceof Error) { - return done.fail(error.stack); - } - return done.fail(JSON.stringify(error)); - }; -}; diff --git a/services_tests.js b/services_tests.js index 9fd9ae846..58f1bc432 100644 --- a/services_tests.js +++ b/services_tests.js @@ -7,7 +7,7 @@ process.on('warning', warning => { let verbose = false; -if (process.argv[2] === '--v') +if (process.argv[2] === '--v') verbose = true; servicesDir = `${__dirname}/services`; @@ -36,9 +36,7 @@ for (let service of serviceList) { jasmine.loadConfig({ spec_dir: 'services', spec_files: serviceSpecs, - helpers: [ - '/services/utils/jasmineHelpers.js' - ] + helpers: [] }); jasmine.addReporter(new SpecReporter({ diff --git a/smokes_tests.js b/smokes_tests.js index 3cf9d182e..a9c26446c 100644 --- a/smokes_tests.js +++ b/smokes_tests.js @@ -6,24 +6,22 @@ process.on('warning', warning => { console.log(warning.stack); }); -var verbose = false; +let verbose = false; -if (process.argv[2] === '--v') { +if (process.argv[2] === '--v') verbose = true; -} -var Jasmine = require('jasmine'); -var jasmine = new Jasmine(); -var SpecReporter = require('jasmine-spec-reporter').SpecReporter; + +let Jasmine = require('jasmine'); +let jasmine = new Jasmine(); +let SpecReporter = require('jasmine-spec-reporter').SpecReporter; jasmine.loadConfig({ spec_files: [ './e2e/smokes/**/*[sS]pec.js', './e2e/helpers/extensions.js' ], - helpers: [ - '/services/utils/jasmineHelpers.js' - ] + helpers: [] }); jasmine.addReporter(new SpecReporter({