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

Correcting the handling of services that have inherited properties #4

Merged
merged 1 commit into from
May 6, 2015

Conversation

vcabbage
Copy link
Contributor

@vcabbage vcabbage commented May 6, 2015

Object.keys returns only an object's own properties. I ran into an issue where a service was using inheritance internally and the mockService function would not overwrite the inherited properties with _default. Explicitly specifying the inherited property worked but _default did not.

Using the 'for (var key in object)' syntax traverses the prototype chain and allows mockService to overwrite inherited properties not explicitly called out in the config with _default.

wardbell added a commit that referenced this pull request May 6, 2015
Correcting the handling of services that have inherited properties
@wardbell wardbell merged commit 4b1acf8 into wardbell:master May 6, 2015
@wardbell
Copy link
Owner

wardbell commented May 6, 2015

Incorporated in release 0.1.2

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

Successfully merging this pull request may close these issues.

2 participants