-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change e2e snapshot to use allowSharedSnapshot
- Loading branch information
Showing
1 changed file
with
3 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,7 +101,8 @@ normalizeStdout = (str, options = {}) -> | |
.replace(/(Uploading Results.*?\n\n)((.*-.*[\s\S\r]){2,}?)(\n\n)/g, replaceUploadingResults) ## replaces multiple lines of uploading results (since order not guaranteed) | ||
.replace(/^(\- )(\/.*\/packages\/server\/)(.*)$/gm, "$1$3") ## fix "Require stacks" for CI | ||
|
||
str = str.replace(/\(\d{2,4}x\d{2,4}\)/g, "(YYYYxZZZZ)") ## screenshot dimensions | ||
if not options.keepScreenshotDimensions | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jennifer-shehane
Member
|
||
str = str.replace(/\(\d{2,4}x\d{2,4}\)/g, "(YYYYxZZZZ)") ## screenshot dimensions | ||
|
||
return str.split("\n") | ||
.map(replaceStackTraceLines) | ||
|
@@ -413,15 +414,7 @@ module.exports = e2e = { | |
|
||
str = normalizeStdout(stdout, options) | ||
|
||
args = _.compact([options.originalTitle, str]) | ||
|
||
try | ||
snapshot(args...) | ||
catch err | ||
## if this error is from a duplicated snapshot key then | ||
## ignore it else throw | ||
if not err.duplicateSnapshotKey | ||
throw err | ||
snapshot(options.originalTitle, str, { allowSharedSnapshot: true }) | ||
|
||
return { | ||
code: code | ||
|
These kinds of options should be by default given in the affirmative in the typical case. The default here is to do something (to remove the screenshot dimensions) and therefore the default value is
true
.The OVERRIDE is the opt-in, where what you're opting into takes away a behavior.
Since the default option is to always remove the screenshot dimensions, then the override only makes sense to turn this behavior off, which makes more sense as a
false
value.