Skip to content

Commit 85b32a8

Browse files
committed
Update snapshot tests
1 parent f061178 commit 85b32a8

24 files changed

+26
-27
lines changed

.github/workflows/ci.yml

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,41 @@ on:
66
- main
77
pull_request:
88
branches:
9-
- main
9+
- "**"
10+
schedule:
11+
- cron: '3 3 * * 2' # 3:03 AM, every Tuesday
1012

1113
concurrency:
1214
group: ${{ github.ref }}
1315
cancel-in-progress: true
1416

1517
jobs:
16-
CI:
18+
macOS:
19+
name: ${{ matrix.platform }}
1720
runs-on: macos-11
1821
strategy:
1922
fail-fast: false
2023
matrix:
21-
platform: [iOS, macOS]
22-
action: [test, archive]
24+
platform:
25+
- iOS
26+
- macOS
27+
- tvOS
2328
include:
2429
- platform: iOS
25-
action: test
26-
destination: "'platform=iOS Simulator,name=iPhone 8,OS=14.5'"
27-
28-
- platform: iOS
29-
action: archive
30-
destination: "'generic/platform=iOS'"
31-
30+
destination: "'platform=iOS Simulator,name=iPhone 8,OS=15.0'"
3231
- platform: macOS
33-
action: test
34-
destination: "'platform=macOS,arch=x86_64'"
35-
36-
- platform: macOS
37-
action: archive
3832
destination: "'platform=macOS,arch=x86_64'"
33+
- platform: tvOS
34+
destination: "'platform=tvOS Simulator,name=Apple TV,OS=15.0'"
3935
steps:
40-
- name: Git Checkout
41-
uses: actions/checkout@v2
42-
43-
- name: Install Dependencies
44-
run: brew install xcbeautify
45-
46-
- name: ${{ matrix.platform }} ${{ matrix.action }}
36+
- uses: actions/checkout@v2
37+
- uses: maxim-lobanov/setup-xcode@v1
38+
with:
39+
xcode-version: latest-stable
40+
- name: Run Tests
4741
run: |
4842
set -o pipefail && \
49-
xcodebuild clean ${{ matrix.action }} \
43+
xcodebuild clean test \
5044
-destination ${{ matrix.destination }} \
5145
-scheme TextBuilder \
52-
| xcbeautify
46+
| xcpretty

Tests/TextBuilderTests/TextSnapshotHelpers.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,16 @@ func assertTextSnapshot(_ text: Text, file: StaticString = #file, testName: Stri
2323
testName: testName,
2424
line: line
2525
)
26-
#elseif os(iOS)
26+
#else
27+
#if os(iOS)
28+
let os = "iOS"
29+
#elseif os(tvOS)
30+
let os = "tvOS"
31+
#endif
2732
assertSnapshot(
2833
matching: view,
2934
as: .image,
30-
named: "iOS",
35+
named: os,
3136
record: isRecording,
3237
file: file,
3338
testName: testName,
2 Bytes
Loading
6.89 KB
Loading
-9 Bytes
Loading
6.71 KB
Loading
-59 Bytes
Loading
9.13 KB
Loading
-6 Bytes
Loading
8.45 KB
Loading

0 commit comments

Comments
 (0)