[test] Misc improvements to experimental and browser test runner #23699
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
test:karma
: More ergonomic approach to runningtest:karma
with specified browserst
(experimental cli): Fix shorthand for--bail
(-b
) and--inspect-brk
(-d
)Both used
-b
.createClientRender
orcreateMount
are mistakenly called in test hooksThis is not problematic right now as far as I can tell but any potential
before
hook called from withincreateClientRender
would be dropped ifcreateClientRender
is called within abefore
hook.Only
Divider.test
violated this.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".
test:karma
: Remove outdated aliasesThese are no longer needed with [core] Ship modern bundle #22814
test:karma
: Fix knownprocess.env.*
variables being replaced with an object instead of their hardcoded (string) valuesThis currently defeats dead-code-elimination and gets into some weird edge cases if we read from
process.env
which becomes truthy in browser tests.