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:
Cole Lawrence 2022-08-02 09:11:19 -04:00
parent 963b03ab6e
commit ea3e7434c6
3 changed files with 24 additions and 3 deletions

View file

@ -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 && {

View file

@ -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