Skip to content
This repository was archived by the owner on Jul 29, 2024. It is now read-only.

addMockModules permits duplicate module names? #764

Closed
kbaltrinic opened this issue May 1, 2014 · 2 comments
Closed

addMockModules permits duplicate module names? #764

kbaltrinic opened this issue May 1, 2014 · 2 comments

Comments

@kbaltrinic
Copy link

I have not experimented with this but I was looking through the protractor code base and I see what looks like a bug at protractor.js Line 841 and following. It appears entirely possible to add two mock modules with the same name, have them both applied to the browser and then need to call removeMockModule twice with that name to remove them both. Am I reading this right? Is this correct behavior?

@kbaltrinic
Copy link
Author

Looking at this more, there is also a bug in removeMockModule such that if you pass in a module name that does not exist, it does not validate validate the argument. The result being that it will incorrectly remove the most recently added module.

@kbaltrinic
Copy link
Author

So at this point I have written unit tests that confirm both behaviors malfunction as I suspected and have submitted a pull request containing the confirming tests and associated fixes. Someone may want to review my unit tests. I think there may be a better approach.

@juliemr juliemr added the bug label May 16, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants