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

[test] Misc improvements to experimental and browser test runner #23699

Merged
merged 8 commits into from
Nov 25, 2020

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Nov 24, 2020

  1. test:karma: More ergonomic approach to running test:karma with specified browsers
    -`yarn test:karma --browsers BrowserStack_Chrome,ChromeHeadlessNoSandBox,BrowserStack_Safari,BrowserStack_Firefox,BrowserStack_Firefox`
    +`yarn test:karma --browsers chrome,chromeHeadless,safari,firefox,edge`
  2. t (experimental cli): Fix shorthand for --bail (-b) and --inspect-brk (-d)
    Both used -b.
  3. Explicitly throw if createClientRender or createMount are mistakenly called in test hooks
    This is not problematic right now as far as I can tell but any potential before hook called from within createClientRender would be dropped if createClientRender is called within a before hook.
    Only Divider.test violated this.
  4. t: Allow testing in production environment.
    Does not work for all tests. Adding it now to gradually works towards enabling tests in prod.
    Tests should not do/assert something that actual users will never see. By only running in development we risk moving away from the "real world".
  5. test:karma: Remove outdated aliases
    These are no longer needed with [core] Ship modern bundle #22814
  6. test:karma: Fix known process.env.* variables being replaced with an object instead of their hardcoded (string) values
    This currently defeats dead-code-elimination and gets into some weird edge cases if we read from process.env which becomes truthy in browser tests.

@eps1lon eps1lon added the test label Nov 24, 2020
}
});

afterEach(() => {
Copy link
Member Author

Choose a reason for hiding this comment

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

was afterEach(async () => {) which we no longer need now that cleanup is sync.

@mui-pr-bot
Copy link

mui-pr-bot commented Nov 24, 2020

No bundle size changes

Generated by 🚫 dangerJS against 8948c5c

@eps1lon eps1lon marked this pull request as ready for review November 24, 2020 13:17
@eps1lon eps1lon merged commit 15ed384 into mui:next Nov 25, 2020
@eps1lon eps1lon deleted the test/karma-cleanup branch November 25, 2020 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants