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

fix: validating async functions (#7894) #7896

Merged
merged 1 commit into from Feb 14, 2019
Merged

fix: validating async functions (#7894) #7896

merged 1 commit into from Feb 14, 2019

Conversation

ehmicky
Copy link
Contributor

@ehmicky ehmicky commented Feb 14, 2019

Summary

jest-validate distinguishes between sync and async functions, but it should not. Fixes #7894.

Test plan

const { validate } = require('jest-validate')
assert(validate({ name: async () => {} }, { exampleConfig: { name: () => {} } }).isValid)
assert(validate({ name: () => {} }, { exampleConfig: { name: async () => {} } }).isValid)
assert(validate({ name: async () => {} }, { exampleConfig: { name: async () => {} } }).isValid)
assert(validate({ name: () => {} }, { exampleConfig: { name: () => {} } }).isValid)

@codecov-io
Copy link

Codecov Report

Merging #7896 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7896   +/-   ##
=======================================
  Coverage   58.15%   58.15%           
=======================================
  Files         173      173           
  Lines        6424     6424           
  Branches        5        6    +1     
=======================================
  Hits         3736     3736           
  Misses       2686     2686           
  Partials        2        2
Impacted Files Coverage Δ
packages/jest-validate/src/condition.js 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af1ab24...fb50e03. Read the comment docs.

@thymikee thymikee merged commit 0c1d5f9 into jestjs:master Feb 14, 2019
@thymikee
Copy link
Collaborator

Thank you so much!

@ehmicky ehmicky deleted the bug/jest-validate-async-functions branch February 14, 2019 14:02
@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 12, 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.

jest-validate does not work well with async functions
4 participants