File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -137,10 +137,14 @@ final class PublishDiagnosticsTests: XCTestCase {
137137 )
138138
139139 _ = try project. openDocument ( " FileB.swift " )
140- let diagnosticsBeforeChangingFileA = try await project. testClient. nextDiagnosticsNotification ( )
141- XCTAssert (
142- diagnosticsBeforeChangingFileA. diagnostics. contains ( where: { $0. message == " Cannot find 'sayHello' in scope " } )
143- )
140+ try await repeatUntilExpectedResult {
141+ let diagnostics = try await project. testClient. nextDiagnosticsNotification ( )
142+ if diagnostics. diagnostics. contains ( where: { $0. message == " Cannot find 'sayHello' in scope " } ) {
143+ return true
144+ }
145+ logger. debug ( " Received unexpected diagnostics: \( diagnostics. forLogging) " )
146+ return false
147+ }
144148
145149 let updatedACode = " func sayHello() {} "
146150 let aUri = try project. uri ( for: " FileA.swift " )
You can’t perform that action at this time.
0 commit comments