I am using an mocha.opts file to configure my tests in VS Code.
DeprecationWarning: Configuration via mocha.opts is DEPRECATED and will be removed from a future version of Mocha. Use RC files or package.json instead.
I am unable to run my tests now and would like to migrate to a mocharc file. I don't mind the mocharc format being yaml or json. The mocha documentation is lengthy and doesn't provide migration examples.
Q1: How to do that, are there any examples?
EDIT:
I have found this: https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.yml
Which is an example of a .mocharc.yaml config containing all possible fields.
Q2: What about env vars, I could set them in mocha.opts, how to do that in the .mocharc?