Skip to content

Commit 05b6fb8

Browse files
committed
Fix issue where preview tests would assert if one encountered an error
1 parent 7c81333 commit 05b6fb8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Tests/SwiftDocCUtilitiesTests/PreviewActionIntegrationTests.swift

+7-1
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,13 @@ class PreviewActionIntegrationTests: XCTestCase {
305305
XCTFail("Could not create preview action from parameters", file: file, line: line)
306306
return
307307
}
308+
defer {
309+
do {
310+
try preview.stop()
311+
} catch {
312+
XCTFail("Failed to stop preview server", file: file, line: line)
313+
}
314+
}
308315
// Start watching the source and get the initial (successful) state.
309316
do {
310317
let engine = preview.convertAction.diagnosticEngine
@@ -340,7 +347,6 @@ class PreviewActionIntegrationTests: XCTestCase {
340347
wait(for: [logOutputExpectation, erroredExpectation], timeout: 20.0)
341348
logTimer.invalidate()
342349
}
343-
try preview.stop()
344350
#endif
345351
}
346352

0 commit comments

Comments
 (0)