question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ok() is not a function

See original GitHub issue

Hello!

Thank you for this great library!

I’m using a construct like this: expect(value).to.not.be.ok(), however, I’m getting an error cause ok is not a function.

When I use it like this: expect(value).to.not.be.ok, it works fine, but raises an error in my IDE, cause this construct is not a call and is not assigned to anything, i.e. redundant construct.

I think it makes sense to make such constructs at least look like a normal function call like in my firxt example: expect(value).to.not.be.ok().

What do you think? Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
keithamuscommented, Apr 26, 2016

Just to clarify the matter: we still get lots of requests regarding this. I think eventually, when we tackle some of the things on the Roadmap - we’ll have the flexibility of offering interfaces which don’t use properties. But I think it’d be very turbulent to change things right now. For now, linters & IDEs can be tweaked, or you can use dirty-chai - as @meeber mentioned.

I’ll close this because of all of the above discussion, which is to say “we’re not saying wontfix, just wontfix-right-now”.

3reactions
meebercommented, Apr 25, 2016

I think it’s worth looking into again. Just to make sure we don’t duplicate past efforts, here is a quote from @keithamus in the #371 thread that contains a ton of background information related to the original fix to this issue and the reason it got reverted:

  • #41 was the initial proposal to add method syntax (.to.be.true()).
  • #297 was the PR that was merged by me.
  • #302 is where the original discovery that the two styles were incompatible with each other was.
  • #306 is where we reverted the change.
  • #321 and #326 are duplicates of this issue.
Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript TypeError: "x" is not a function occurs when calling a function on a value or object, which is not actually a...
Read more >
Uncaught (in promise) TypeError: response.json is not a function
One use case of doing so would be when you are making a HTTP request using the fetch API, whereby you will have...
Read more >
JavaScript error: Response.json is not a function | Bugfixes
Follow Me Online Here: My website/blog - https://peterelbaum.com✉️ My newsletter (weekly on Sundays) ...
Read more >
TypeError: response.json is not a function in JavaScript
The "response.json is not a function" error occurs when we call the json() method on an object that is not the Response object...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found