-
Notifications
You must be signed in to change notification settings - Fork 5
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
Support usage of custom mocharc file #3
Comments
This would be a great enhancement. The config will probably have to be split inside |
Out of curiosity, if the reporter/reporter-options are configured via the mocharc.json and sent only to the mocha instance, would you expect the mocha instance to use it properly (e.g. create output files)? If that's the case, would the config file need to be split so the cli knows what to output? e.g. when using reporter=dot |
Well, no, that's not how it works. Check out the illustration at the bottom of the README.md: https://github.com/larsthorup/mocha-vite-puppeteer/ The mocha instance runs inside the browser and has no access to the file system or anything like that. Its only access to the outside world is via |
Ah, I understand what you mean now. Thank you for the explanation! |
If custom mocharc files are supported, it would allow for a lot more flexibility in projects. It might also remove the need to explicitly support other cli options like reporter/reporter-options, as those could just be set in the config file.
Standard mocharc files are usually one of type: js, json, jsonc, yml, yaml.
mocharc.js requires using
"type" = "module"
in the package.jsonsome resources:
mocha config file documentations
mocha cli loadOptions documentation
I did some testing inside the test.html to determine if a config could be passed via something like:
mocha.setup({ "ui": "bdd", "config":"./mocharc.json" });
but it doesn't appear passing a config or options key is allowed here.
The text was updated successfully, but these errors were encountered: