-
-
Notifications
You must be signed in to change notification settings - Fork 701
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
Uncaught TypeError: Cannot read property 'CHAI_COV' of undefined #28
Comments
The process.env is located in ./index.js and it should not be a problem. In order to use chai in the browser you need to load only ./chai.js, which is the compiled version of chai for browser use only. Full, working example: http://chaijs.com/support/tests/ |
You can also hot link to |
Thanks guys for the response. The problem is that since we use |
oh! well that makes sense! I will make a work around to check to see if process and process.env exist so that you can still use via browserify. |
In release 0.4.2. If you have further problems with a browserify implementation, please reopen this issue. |
Awesome; that fixed the issue! |
Great! |
chai@1.3.0
The |
@logicalparadox that commit only fixes the |
The error that is being thrown is from browserify's "compile" sequence, not at run time then? |
Hmm this is a tough one. Personally I've always hated the conditional require of lib-cov; I think it's a very shoddy and intrusive way of doing code coverage. Is there a way to not do that? Failing that, we could add
to package.json; that might fix things. |
The other idea im liking even more is to have the package.json main be './lib/chai' and leave the conditionals for coverage support to our test bootstrap. |
+1 to that |
@logicalparadox I actually need this for a new project. I verified that the fix to change |
Go ahead and push. The tests will still require |
still does not work |
Hello,
We are using
chai.js
withmocha
and we run our tests in the browser...It looks like a recent version of Chai introduced a little bug:
Uncaught TypeError: Cannot read property 'CHAI_COV' of undefined
.It looks like it's coming from the fact that you now use process.env.CHAI_COV to load the appropriate library... and process.env does not seem to exist in the browser.
The text was updated successfully, but these errors were encountered: