refactor to avoid using import on backend testing env

This commit is contained in:
Carlos Jimenez 2018-01-31 12:02:35 +01:00
parent 215ae09b70
commit cd027a3e12
10 changed files with 22 additions and 22 deletions

View File

@ -1,6 +1,6 @@
let app = require('../../../server/server');
let routes = require('../routes');
let restoreFixtures = require('../../../../../services/db/testing_fixtures');
const app = require('../../../server/server');
const routes = require('../routes');
const restoreFixtures = require('../../../../../services/db/testing_fixtures');
describe('Auth routes', () => {
let fixturesToApply = {tables: ['`salix`.`user`'], inserts: [

View File

@ -1,5 +1,5 @@
let app = require('../../../../server/server');
let catchErrors = require('../../../../../../services/utils/jasmineHelpers');
const app = require('../../../../server/server');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers');
describe('Client addresses', () => {
it('should call the addressesList method and receive total results and items', done => {

View File

@ -1,6 +1,6 @@
let app = require('../../../../server/server');
let catchErrors = require('../../../../../../services/utils/jasmineHelpers');
let restoreFixtures = require('../../../../../../services/db/testing_fixtures');
const app = require('../../../../server/server');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
const restoreFixtures = require('../../../../../../services/db/testing_fixtures');
describe('Client addressesPropagateRe', () => {
let fixturesToApply = {tables: ['`account`.`user`', '`vn2008`.`Clientes`', '`vn2008`.`Consignatarios`'], inserts: [

View File

@ -1,5 +1,5 @@
let app = require('../../../../server/server');
let catchErrors = require('../../../../../../services/utils/jasmineHelpers');
const app = require('../../../../server/server');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
describe('Client card', () => {
it('should call the card() method to receive a formated card of Bruce Wayne', done => {

View File

@ -1,6 +1,6 @@
let app = require('../../../../server/server');
let catchErrors = require('../../../../../../services/utils/jasmineHelpers');
let restoreFixtures = require('../../../../../../services/db/testing_fixtures');
const app = require('../../../../server/server');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
const restoreFixtures = require('../../../../../../services/db/testing_fixtures');
describe('Client Create', () => {
let fixturesToApply = {tables: ['`account`.`user`', '`vn2008`.`Clientes`', '`vn2008`.`Consignatarios`'], inserts: [

View File

@ -1,5 +1,5 @@
let app = require('../../../../server/server');
let catchErrors = require('../../../../../../services/utils/jasmineHelpers');
const app = require('../../../../server/server');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
describe('Client employeeList', () => {
it('should call the employeeList()', done => {

View File

@ -1,5 +1,5 @@
let app = require('../../../../server/server');
let catchErrors = require('../../../../../../services/utils/jasmineHelpers');
const app = require('../../../../server/server');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
describe('Client getRoleCustomer', () => {
it('should call the getRoleCustomer() method with a customer id', done => {

View File

@ -1,5 +1,5 @@
let app = require('../../../../server/server');
let catchErrors = require('../../../../../../services/utils/jasmineHelpers');
const app = require('../../../../server/server');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
describe('Client activeSalesPerson', () => {
it('should call the activeSalesPerson() method with limit of 1', done => {

View File

@ -1,5 +1,5 @@
let totalGreuge = require('../total');
let catchErrors = require('../../../../../../services/utils/jasmineHelpers');
const totalGreuge = require('../total');
const catchErrors = require('../../../../../../services/utils/jasmineHelpers').catchErrors;
describe('Greuge totalGreuge()', () => {
it('should call the sumAmount method', done => {

View File

@ -1,4 +1,4 @@
module.exports = function catchErrors(done) {
module.exports.catchErrors = function(done) {
return error => {
if (error instanceof Error) {
return done.fail(error.stack);