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

Clarify mocking of window.Promise #25

Open
cburgmer opened this issue Oct 30, 2016 · 1 comment
Open

Clarify mocking of window.Promise #25

cburgmer opened this issue Oct 30, 2016 · 1 comment

Comments

@cburgmer
Copy link

I'm using es6-promise.auto.js to provide a shim when testing with PhantomJS. It wasn't obvious which method of mocking applied to me, and as for the built-in Promise, it was unclear that it's up to me to "hot swap" the constructor.

Right now I'm doing

    beforeEach(function () {
        window.Promise = mockPromises.getMockPromise(Promise);
    });

    afterEach(function () {
        window.Promise = mockPromises.getOriginalPromise();
    });

Calling this example out would help a newbie like me :)

@charleshansen
Copy link
Owner

Sure, I'll add something. Glad it worked for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants