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(
2424 let existingSnapshot = try String ( contentsOf: snapshotPath, encoding: . utf8)
2525 let ok = existingSnapshot == String ( data: input, encoding: . utf8) !
2626 let actualFilePath = snapshotPath. path + " .actual "
27+ let updateSnapshots = ProcessInfo . processInfo. environment [ " UPDATE_SNAPSHOTS " ] != nil
2728 func buildComment( ) -> Comment {
2829 " Snapshot mismatch: \( actualFilePath) \( snapshotPath. path) "
2930 }
30- if !ok {
31- try input. write ( to: URL ( fileURLWithPath: actualFilePath) )
32- }
33- if ProcessInfo . processInfo. environment [ " UPDATE_SNAPSHOTS " ] == nil {
31+ if !updateSnapshots {
3432 #expect( ok, buildComment ( ) , sourceLocation: sourceLocation)
33+ if !ok {
34+ try input. write ( to: URL ( fileURLWithPath: actualFilePath) )
35+ }
3536 } else {
3637 try input. write ( to: snapshotPath)
3738 }
You can’t perform that action at this time.
0 commit comments