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

Tests don't work in cloud due to global expect #67

Closed
ljharb opened this issue May 14, 2013 · 9 comments
Closed

Tests don't work in cloud due to global expect #67

ljharb opened this issue May 14, 2013 · 9 comments
Labels

Comments

@ljharb
Copy link
Collaborator

ljharb commented May 14, 2013

I think that worrying about index.html for tests is a problem. It forces, in particular, relying on a global "expect" to be set (that test_helpers sets for command-line). It makes testling tests fail, and I can only assume jepso tests as well.

I think that it would be better to eliminate the HTML entirely, or at least, use browserify to output all the JS for the html file (and store it in the repo if necessary). That way, the tests could be tweaked to only work in a node environment, but the html file would still be usable if someone wanted it (although I'm not sure why they would).

Thoughts?

@ghost ghost assigned paulmillr May 14, 2013
@paulmillr
Copy link
Owner

feel free to create files like browser-helpers.js and browser-initialize.js for that

@ljharb
Copy link
Collaborator Author

ljharb commented May 15, 2013

I guess what I'm saying is, why do we have the index.html at all? The order of importance for testing environments imo is node, travis, testling/jepso/browser test clouds, and then maybe a local html file.

@paulmillr
Copy link
Owner

How to test stuff locally without this file?

paulmillr added a commit that referenced this issue May 17, 2013
@paulmillr
Copy link
Owner

done?

@ljharb
Copy link
Collaborator Author

ljharb commented May 17, 2013

That's an improvement :-) testling now says ReferenceError: Can't find variable: chai on line 866 on http://git.testling.com/work/paulmillr/repos/31b9315f6a7bd0a3fbb26dc58117e9431a930012.1368770165025/1368770165211.2d094fdc.html

@ljharb
Copy link
Collaborator Author

ljharb commented May 20, 2013

Also, npm test now doesn't work on the command-line. I get ReferenceError: window is not defined in test/browser-onload.js

@ljharb
Copy link
Collaborator Author

ljharb commented May 20, 2013

To test stuff locally, we'd use browserify locally to generate the assets (with node-style requires) and keep the html file. In order to do that, though, it needs to first work on the command line with npm test, and I'm not sure how to do that without first decimating the HTML file

@paulmillr
Copy link
Owner

npm tests fixd

@cscott
Copy link
Collaborator

cscott commented Oct 11, 2013

Fixed all this in pull request #152.

@cscott cscott closed this as completed Sep 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants