You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to make it work with Jest. Every time I require this into my simple test it goes into an infinite loop. While debugging I also saw that it is throwing an exception on line 70.
demandware-globals.js
#!javascript
try {
// the line below is throwing exception TypeError: require is not a constructor
global[pathArray[0]][pathArray[1]][pathArray[2]] = require("./"+classPath);
} catch(e){
console.log("Could not require "+classPath+e);
}
My test:
#!javascript
'use strict'
require('dw-api-mock/demandware-globals');
describe('COBilling',() => {
describe('SelectCreditCard',() => {
it('should call the method on Cybersource to save the card', () => {
expect(2).toBe(2);
});
});
});
The text was updated successfully, but these errors were encountered:
I am trying to make it work with Jest. Every time I require this into my simple test it goes into an infinite loop. While debugging I also saw that it is throwing an exception on line 70.
demandware-globals.js
My test:
The text was updated successfully, but these errors were encountered: