Skip to content

Commit

Permalink
fix(keyboard): add link to README in key descriptor error (#666)
Browse files Browse the repository at this point in the history
  • Loading branch information
ph-fritsche committed Apr 28, 2021
1 parent 1560b29 commit ebc90d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/keyboard/index.ts
Expand Up @@ -95,7 +95,7 @@ describe('error', () => {
expect(err).toHaveBeenCalledWith(expect.any(Error) as unknown)
expect(err.mock.calls[0][0]).toHaveProperty(
'message',
'Expected key descriptor but found "!" in "{!"',
expect.stringContaining('Expected key descriptor but found "!" in "{!"'),
)
})

Expand Down
4 changes: 3 additions & 1 deletion src/keyboard/getNextKeyDef.ts
Expand Up @@ -141,5 +141,7 @@ function getErrorMessage(
found: string | undefined,
text: string,
) {
return `Expected ${expected} but found "${found ?? ''}" in "${text}"`
return `Expected ${expected} but found "${found ?? ''}" in "${text}"
See https://github.com/testing-library/user-event/blob/master/README.md#keyboardtext-options
for more information about how userEvent parses your input.`
}

0 comments on commit ebc90d8

Please sign in to comment.