Fix e2e visual regression tests by always showing Updates badge in CI
- ensure that window.__IS_VISUAL_REGRESSION_TESTING is true when CI=1
This commit is contained in:
parent
963b03ab6e
commit
ea3e7434c6
3 changed files with 24 additions and 3 deletions
|
@ -25,6 +25,8 @@ const testDir = playgroundDir('src/tests')
|
|||
export async function start(options: {
|
||||
/** enable live reload and watching stuff */
|
||||
dev: boolean
|
||||
/** make some UI elements predictable by setting the __IS_VISUAL_REGRESSION_TESTING value on window */
|
||||
isVisualRegressionTesting: boolean
|
||||
serve?: {
|
||||
findAvailablePort: boolean
|
||||
openBrowser: boolean
|
||||
|
@ -169,7 +171,9 @@ export async function start(options: {
|
|||
},
|
||||
define: {
|
||||
...definedGlobals,
|
||||
'window.__IS_VISUAL_REGRESSION_TESTING': 'true',
|
||||
'window.__IS_VISUAL_REGRESSION_TESTING': JSON.stringify(
|
||||
options.isVisualRegressionTesting,
|
||||
),
|
||||
},
|
||||
banner: liveReload?.esbuildBanner,
|
||||
watch: liveReload?.esbuildWatch && {
|
||||
|
|
|
@ -21,6 +21,7 @@ function onUpdatedBuildScript(rebuild) {
|
|||
module
|
||||
.start({
|
||||
dev: !isCI && dev,
|
||||
isVisualRegressionTesting: isCI,
|
||||
serve: serve && {
|
||||
findAvailablePort: !isCI,
|
||||
// If not in CI, try to spawn a browser
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue