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

Type assertion fails when given function constructor #354

Closed
i-like-robots opened this issue Feb 28, 2017 · 0 comments
Closed

Type assertion fails when given function constructor #354

i-like-robots opened this issue Feb 28, 2017 · 0 comments

Comments

@i-like-robots
Copy link

Hello, I think I've found a bug when attempting to use the type assertion. I would expect the second assertion in the test case given below to pass based on the following documentation:

Type can be a string that matches the typeof value of the object, or the string name of any constructor in the object’s prototype chain, or a constructor function in the object’s prototype chain.

And here is a simple test case:

> t.type(new Function, 'function')
# ok 1 - type is function
# true 

> t.type(new Function, Function)
# not ok 2 - type is Function
# false

Details:

  • Using Tap 10.2.2
  • This error can be worked around by providing a string value (for typeof use case)

If this is confirmed as a bug I'd be happy to help fix it.

@isaacs isaacs closed this as completed in 1892366 Jun 18, 2017
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