refactor to avoid using import on backend testing env
This commit is contained in:
parent
215ae09b70
commit
cd027a3e12
|
@ -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: [
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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: [
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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: [
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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 => {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue