Skip to content

Commit 165019b

Browse files
f-melonistephencelis
authored andcommitted
Create a typealias for SnapshotTestCase when not on Linux (#169)
* Create a typealias for SnapshotTestCase when not on Linux * Deprecate SnapshotTestCase typealias on swift 5 * Added renamed to the SnapshotTestCase typealias
1 parent ca034ac commit 165019b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

Sources/SnapshotTesting/SnapshotTestCase.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
#if os(Linux)
21
import XCTest
32

3+
#if !os(Linux)
4+
@available(swift, obsoleted: 5.0, renamed: "XCTestCase", message: "Please use XCTestCase instead")
5+
public typealias SnapshotTestCase = XCTestCase
6+
#else
7+
48
/// An XCTest subclass that provides snaphot testing helpers.
59
open class SnapshotTestCase: XCTestCase {
610
/// Whether or not to record all new references.

Tests/SnapshotTestingTests/SnapshotTestingTests.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,7 @@ import SpriteKit
99
import WebKit
1010
#endif
1111

12-
#if os(Linux)
13-
typealias TestCase = SnapshotTestCase
14-
#else
15-
typealias TestCase = XCTestCase
16-
#endif
17-
18-
class SnapshotTestingTests: TestCase {
12+
final class SnapshotTestingTests: SnapshotTestCase {
1913
override func setUp() {
2014
super.setUp()
2115
diffTool = "ksdiff"

0 commit comments

Comments
 (0)