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

[Issue-370] - Update createTestDoublesForFunctionNames to return an object #421

Merged
merged 1 commit into from
Jul 3, 2019
Merged

[Issue-370] - Update createTestDoublesForFunctionNames to return an object #421

merged 1 commit into from
Jul 3, 2019

Conversation

bannmoore
Copy link
Contributor

@bannmoore bannmoore commented Jul 3, 2019

cc @primarilysnark

This PR addresses Issue 370.

Context: When td.object is called with an array of function names, it returns an array; my understanding of the issue is that td.object should always return an object.

From the original issue:

> td.object({ something() {} }).splice
undefined
> td.object(['something']).splice
[Function: splice]

Included Changes:

  • Add an assertion to the td.object w/ array of function names test, to confirm that the resulting object is not an array.
  • Add a base value of {} to the accumulator in createTestDoublesForFunctionNames, to ensure that it responds with an object.

@primarilysnark primarilysnark self-assigned this Jul 3, 2019
Copy link
Contributor

@primarilysnark primarilysnark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks for addressing this annoying error. 👍

@searls searls merged commit 0aa4cfe into testdouble:master Jul 3, 2019
@searls
Copy link
Member

searls commented Jul 3, 2019

Landed in v3.12.1

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.

None yet

3 participants