garbles / garbles/kitimat

Jest reporter doesn't show failing arguments

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
68
Forks
1
PR merge metrics
No merged PRs in 30d

Description

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:

```js
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 | });
...
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.