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

util should be polyfilled for mocha #297

Closed
PaperStrike opened this issue Sep 10, 2021 · 2 comments · Fixed by #317
Closed

util should be polyfilled for mocha #297

PaperStrike opened this issue Sep 10, 2021 · 2 comments · Fixed by #317
Assignees
Labels
bug Something isn't working

Comments

@PaperStrike
Copy link
Contributor

Describe the bug
mocha uses util and without this it can't be bundled up. Currently no errors in the test cases as the browser-compatible util is listed as a dep of assert and the test cases in this repo run with it.

To Reproduce

git clone ...
git switch -c test-mocha-util
yarn install
yarn remove assert

create a file named example.js, with the following lines:

it('should work', () => {});

run node ./cli.js example.js, and you will see the error.

@hugomrdias hugomrdias self-assigned this Sep 13, 2021
@hugomrdias hugomrdias added the bug Something isn't working label Sep 13, 2021
@PaperStrike
Copy link
Contributor Author

I found there is a better way to solve this, other than listing util as a dependency, we can use mocha's official mocha-es2018.js bundle.

@PaperStrike
Copy link
Contributor Author

PaperStrike commented Sep 15, 2021

The question is mocha.js or mocha-es2018.js, since the latter is only there since 9.0.1 (mochajs/mocha#4657).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants