Skip to content

Consolidate mocha configurations into config file. #1469

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

Merged
merged 2 commits into from
Jan 16, 2019
Merged

Conversation

yifanyang
Copy link
Contributor

No description provided.

# - https://github.com/karma-runner/karma-mocha for more information on all mocha flags which the
# karma runner supports.
--timeout 20000
--retry 3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are coming from mocha.base.js, which gets deleted in this pr.

Copy link
Contributor Author

@yifanyang yifanyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now our node test and browser test use different mocha options, which leads to mocha.browser.opts and mocha.node.opts coexist in this pr. The discrepancies are about timeout and retry. Does it make sense to use same timeout and retry for both node and browser test? That way we can have only one copy of the config file.

@yifanyang
Copy link
Contributor Author

@Feiyang1 Can you please invite other folks who you think should also weigh in to review this pr?

@mikelehen
Copy link
Contributor

I'd be fine with trying a single config for node/browser and see if we run into issues.

Just to be clear, before this PR we didn't have a shared config for node, right (mocha.base.js was only being used for browser) and so we were just getting whatever the mocha defaults were (except for the packages that are explicitly passing timeouts on the command-line)? On that note, I think we should remove all of the timeouts / retries being passed on the command-line. I think those were only to override the mocha default, since we didn't have a shared mocha config for node.

@yifanyang
Copy link
Contributor Author

Yes. mocha.base.js was only meant for browser tests. For node tests that don't set timeouts or retries on the command line, they will get mocha default.

Even with the config file, the test itself can still override it by setting options on the cli explicitly.

@Feiyang1
Copy link
Member

I'm fine with sharing the same config for browser and nodejs. To Michael's point, let's move all the config options into the mocha config file.

@yifanyang
Copy link
Contributor Author

I have taken a closer look. There are some test options (e.g. --require ts-node/register, --exit) that node tests need but are not applicable to browser tests. If node and browser tests are to use the same mocha config file, then the node specific options will have to stay on command line.

So in our case, we probably will have to keep two mocha config files -- one for node and the other for browser. Also, this way we could use different test options for node and browser, which is also the way we have been doing since the beginning.

@Feiyang1
Copy link
Member

Okay. I'm okay with 2 config files since node tests and browser tests need different parameters. Thanks.

@yifanyang yifanyang merged commit 45b0591 into master Jan 16, 2019
@yifanyang yifanyang deleted the yifany/mocha branch January 16, 2019 21:47
@firebase firebase locked and limited conversation to collaborators Oct 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants