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

Add test262 test cases. #381

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add test262 test cases. #381

wants to merge 1 commit into from

Conversation

cscott
Copy link
Collaborator

@cscott cscott commented Dec 12, 2015

This currently only works on node, and only runs Promise-related test cases.

It could be generalized to run a larger subset of the ES2015 test cases, and to not fail horribly when run in a browser.

This currently only works on node, and only runs Promise-related test cases.
It could be generalized to run a larger subset of the ES2015 test cases,
and to not fail horribly when run in a browser.
@ljharb
Copy link
Collaborator

ljharb commented Dec 12, 2015

I'd love to add all of test262's relevant test cases - but I'm skeptical about "not [failing] horribly when run in a browser" :-)

@cscott
Copy link
Collaborator Author

cscott commented Dec 12, 2015

Well, since the browser doesn't have access to npm, you'd either have to (a) make the test262 package accessible somehow from within the browser, or (b) run some pre-processing step to turn all the test262 test cases into individual mocha tests inside the test directory. Option (b) is probably not too hard, actually.

The other issue with running more of test262 is that they expect each test to have an isolated environment -- ie, you can stomp on a global, and then when you're running the next test things should go back to normal. Mocha doesn't provide that by default. I've deal with this so far by blacklisting the Promise-related tests which stomp on globals; it would be nice to have a better solution.

@cscott
Copy link
Collaborator Author

cscott commented Dec 12, 2015

I should have said that option (c) is just to do a test for typeof process === 'undefined' and if so, bail out of the test case. That would just skip those tests when run in a browser, which would be the minimum thing necessary to "avoid failing horribly".

@ljharb ljharb force-pushed the master branch 3 times, most recently from 9647bf8 to 49a96e8 Compare October 24, 2023 23:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants