Backend tests fixed

This commit is contained in:
Juan Ferrer Toribio 2018-01-31 13:40:26 +01:00
parent cba0645f92
commit 9090c56c64
9 changed files with 6 additions and 6 deletions

View File

@ -3,13 +3,13 @@ const catchErrors = require('../../../../../../services/utils/jasmineHelpers').c
describe('Client listWorkers', () => { describe('Client listWorkers', () => {
it('should call the listWorkers()', done => { it('should call the listWorkers()', done => {
let callback = (error, result) => { app.models.Client.listWorkers()
if (error) return catchErrors(done)(error); .then(result => {
let amountOfEmployees = Object.keys(result).length; let amountOfEmployees = Object.keys(result).length;
expect(amountOfEmployees).toEqual(6); expect(amountOfEmployees).toEqual(6);
done(); done();
}; })
app.models.Client.listWorkers(callback); .catch(catchErrors(done));
}); });
}); });

View File

@ -1,4 +1,4 @@
const totalGreuge = require('../total'); const totalGreuge = require('../sumAmount');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors; const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
describe('Greuge totalGreuge()', () => { describe('Greuge totalGreuge()', () => {

View File

@ -26,7 +26,7 @@ function vnBoot(app, rootDir, rootModule) {
// View // View
let viewDir = path.join(rootDir, '../client'); let viewDir = `${rootDir}/../client`;
if (fs.existsSync(viewDir)) { if (fs.existsSync(viewDir)) {
app.set('view engine', 'ejs'); app.set('view engine', 'ejs');