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

Jest reporter doesn't show failing arguments #16

Open
chrismilleruk opened this issue Feb 21, 2020 · 0 comments
Open

Jest reporter doesn't show failing arguments #16

chrismilleruk opened this issue Feb 21, 2020 · 0 comments

Comments

@chrismilleruk
Copy link

chrismilleruk commented Feb 21, 2020

While experimenting with this library, I found an issue that seemingly makes it very difficult to work with. It could be that I'm doing something wrong, or that there have been changes in jest since this library was last updated.

Demonstration code:
https://github.com/chrismilleruk/testapp/tree/kitimat-jest

Given a simple generative test which fails:

check('Always starts with a letter', 
  [string(), string()], 
  (generatedPrefix, generatedName) => {
  const module = new Greeting(generatedPrefix);
  const result = module.sayHello(generatedName);

  // Always starts with a letter
  expect(result[0]).toMatch(/[A-Za-z]/);
});

The reporter output doesn't provide

  • the arguments which caused the failure.
  • the seed used to create the arguments.
...
✕ Always starts with a letter (seed: undefined, source: undefined) (26ms)
✓ Has four basic formats (33ms)

● Greeting Class › Always starts with a letter (seed: undefined, source: undefined)

expect(received).toMatch(expected)

Expected pattern: /[A-Za-z]/
Received string:  " "

  37 |
  38 |     // Always starts with a letter
> 39 |     expect(result[0]).toMatch(/[A-Za-z]/);
     |                       ^
  40 |   });
...
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

No branches or pull requests

1 participant