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

Missing .nested.include and .own.include #905

Closed
meeber opened this issue Jan 18, 2017 · 6 comments
Closed

Missing .nested.include and .own.include #905

meeber opened this issue Jan 18, 2017 · 6 comments

Comments

@meeber
Copy link
Contributor

meeber commented Jan 18, 2017

The nested and own flags currently work correctly with the .include assertion, but it's not documented or tested. Also, this functionality isn't currently exposed via the assert interface.

Note that I'm already making some documentation updates that include this, but the issue with the tests and assert interface are still outstanding.

@meeber
Copy link
Contributor Author

meeber commented Apr 23, 2017

BDD docs and tests were updated to resolve most of this issue. Still outstanding: Exposing on assert interface and adding tests.

@zetamorph
Copy link
Contributor

I would like to do this and already read the contributor guide and familiarised myself with the coding style, but just to clarify, that task would also entail exposing the .deepNestedInclude, .deepOwnInclude(and the negated versions, respectively) methods on the assert interface?

@meeber
Copy link
Contributor Author

meeber commented Apr 29, 2017

@zetamorph Yup, exactly. For tests, I'd recommend just duplicating the ones for each combination from the expect test suite, and then converting them over to assert-style. For example here. It's okay to combine both the normal and negated versions into a single it block to make the conversion easier.

Thanks and feel free to reach out with any questions!

@zetamorph
Copy link
Contributor

@meeber Thanks for the heads-up.
I have one question: does the coding style guide, specifically for nested arrays and objects, also strictly apply to examples in the documentation?

I find that the following:

assert.deepNestedInclude(
  {a: 
    {b: 
      [
        {x: 1}
      ]
    }
  }, 
  {'a.b[0]': 
    {x: 1}
  }
);

is much harder to read than this:

assert.deepNestedInclude({ a: { b: [ { x: 1 } ] } }, { 'a.b[0]': { x: 1 } });

@meeber
Copy link
Contributor Author

meeber commented May 4, 2017

@zetamorph Coding examples can be written with a focus on readability. See these examples from the updated BDD docs.

@zetamorph
Copy link
Contributor

@meeber Ok, thanks.
I wasn`t sure because the style guide said that parts of the codebase still follow older styles.
I submitted a pull request, #964.

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

No branches or pull requests

3 participants