File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Plugins/BridgeJS/Tests/BridgeJSToolTests Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -24,14 +24,15 @@ func assertSnapshot(
24
24
let existingSnapshot = try String ( contentsOf: snapshotPath, encoding: . utf8)
25
25
let ok = existingSnapshot == String ( data: input, encoding: . utf8) !
26
26
let actualFilePath = snapshotPath. path + " .actual "
27
+ let updateSnapshots = ProcessInfo . processInfo. environment [ " UPDATE_SNAPSHOTS " ] != nil
27
28
func buildComment( ) -> Comment {
28
29
" Snapshot mismatch: \( actualFilePath) \( snapshotPath. path) "
29
30
}
30
- if !ok {
31
- try input. write ( to: URL ( fileURLWithPath: actualFilePath) )
32
- }
33
- if ProcessInfo . processInfo. environment [ " UPDATE_SNAPSHOTS " ] == nil {
31
+ if !updateSnapshots {
34
32
#expect( ok, buildComment ( ) , sourceLocation: sourceLocation)
33
+ if !ok {
34
+ try input. write ( to: URL ( fileURLWithPath: actualFilePath) )
35
+ }
35
36
} else {
36
37
try input. write ( to: snapshotPath)
37
38
}
You can’t perform that action at this time.
0 commit comments