Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite Loop #1

Open
CCMigration opened this issue Aug 18, 2018 · 0 comments
Open

Infinite Loop #1

CCMigration opened this issue Aug 18, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@CCMigration
Copy link

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);
        });
    });
});
@CCMigration CCMigration added the bug Something isn't working label Aug 18, 2018
SGD1953 pushed a commit that referenced this issue May 21, 2019
…re/ngcatalog-api-mock-isvariationgroup to master

* commit '00326a8743421778fbad6498cf8e607d607c40d8':
  dw.catalog.Product.isVariationGroup() method added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant