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

Test empty Immutable collections with {min: false} option #4121

Merged
merged 3 commits into from
Jul 26, 2017

Conversation

pedrottimark
Copy link
Contributor

Summary

Explicitly specify expected result to prevent regression during work on pretty-format plugins :)

@cpenarrieta can you please confirm? Thank you!

Immutable.OrderedSet [
]
// and so on for {min: false} option

Test plan

Added 8 tests

@cpenarrieta
Copy link
Contributor

@pedrottimark LGTM

@aaronabramov
Copy link
Contributor

i think for pretty-format we should have a more generic test suite.
I was thinking about something like:

const datastructureUnderTest = [
  new Set(),
  new Set([1, "a", Infinity, undefined, null]),
  new Map(),
  new Map([[1, 2], [3, 4]]),
  "string",
  123,
  new Set([
    new Map(),
    new Set([1]),
  ]),
  // etc...
];

expect(prettyPrint(datastructureUnderTest)).toMatchSnapshot();

i think these tests will be easire to write/fix/understand

@cpojer
Copy link
Member

cpojer commented Jul 25, 2017

Seems like it is failing CI.

@thymikee
Copy link
Collaborator

@aaronabramov couldn't agree more. Snapshots would be perfect for testing pretty format output.

@cpojer
Copy link
Member

cpojer commented Jul 25, 2017

I don't agree. Self-hosting the pretty-format tests will lead to weirdness.

@thymikee
Copy link
Collaborator

😞 thought about it for a while, but it was so tempting I forgot...

@pedrottimark
Copy link
Contributor Author

I fixed 2 prettier lint errors (careless me).

Now CircleCI fails with segmentation fault during integration tests in test-ci-partial for Node.js 4

@cpojer cpojer merged commit 45b0ad7 into jestjs:master Jul 26, 2017
@cpojer
Copy link
Member

cpojer commented Jul 26, 2017

Awesome!

@pedrottimark pedrottimark deleted the immutable-tests-empty branch July 26, 2017 15:50
tushardhole pushed a commit to tushardhole/jest that referenced this pull request Aug 21, 2017
* Test empty Immutable collections with {min: false} option

* Make neutral change to code to see if it helps CI

* Fix 2 prettier lint errors
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants