Skip to content

Commit ac3f9c1

Browse files
committed
fix: apply prettier formatting to Swift Testing parser files
1 parent 1f3cb73 commit ac3f9c1

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/utils/__tests__/swift-testing-line-parsers.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('Swift Testing line parsers', () => {
2323

2424
it('should parse a passed test with verbose aka suffix', () => {
2525
const result = parseSwiftTestingResultLine(
26-
"✔ Test \"String operations\" (aka 'stringTest()') passed after 0.001 seconds.",
26+
'✔ Test "String operations" (aka \'stringTest()\') passed after 0.001 seconds.',
2727
);
2828
expect(result).toEqual({
2929
status: 'passed',
@@ -59,7 +59,7 @@ describe('Swift Testing line parsers', () => {
5959

6060
it('should parse a failed test with verbose aka suffix', () => {
6161
const result = parseSwiftTestingResultLine(
62-
"✘ Test \"Expected failure\" (aka 'deliberateFailure()') failed after 0.001 seconds with 1 issue.",
62+
'✘ Test "Expected failure" (aka \'deliberateFailure()\') failed after 0.001 seconds with 1 issue.',
6363
);
6464
expect(result).toEqual({
6565
status: 'failed',
@@ -129,7 +129,7 @@ describe('Swift Testing line parsers', () => {
129129

130130
it('should parse an issue with verbose aka suffix', () => {
131131
const result = parseSwiftTestingIssueLine(
132-
"✘ Test \"Expected failure\" (aka 'deliberateFailure()') recorded an issue at AuditTests.swift:5:5: Expectation failed: true == false",
132+
'✘ Test "Expected failure" (aka \'deliberateFailure()\') recorded an issue at AuditTests.swift:5:5: Expectation failed: true == false',
133133
);
134134
expect(result).toEqual({
135135
rawTestName: 'Expected failure',
@@ -164,7 +164,7 @@ describe('Swift Testing line parsers', () => {
164164

165165
it('should parse an issue without location with verbose aka suffix', () => {
166166
const result = parseSwiftTestingIssueLine(
167-
"✘ Test \"Some test\" (aka 'someFunc()') recorded an issue: Something went wrong",
167+
'✘ Test "Some test" (aka \'someFunc()\') recorded an issue: Something went wrong',
168168
);
169169
expect(result).toEqual({
170170
rawTestName: 'Some test',

src/utils/swift-testing-line-parsers.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@ export function parseSwiftTestingResultLine(line: string): ParsedTestCase | null
6060
// Skipped: ➜ Test funcName() skipped: "reason"
6161
// Also handle legacy format: ◇ Test "Name" skipped
6262
const skippedMatch =
63-
line.match(/^[] Test (\S+?)(?:\(\))? skipped/u) ??
64-
line.match(/^[] Test "(.+)" skipped/u);
63+
line.match(/^[] Test (\S+?)(?:\(\))? skipped/u) ?? line.match(/^[] Test "(.+)" skipped/u);
6564
if (skippedMatch) {
6665
const rawName = skippedMatch[1];
6766
const { suiteName, testName } = parseRawTestName(rawName);
@@ -105,10 +104,7 @@ export function parseSwiftTestingIssueLine(line: string): ParsedFailureDiagnosti
105104
}
106105

107106
// Match without location
108-
const simpleRegex = new RegExp(
109-
`^[✘] Test "(.+)"${OPTIONAL_AKA} recorded an issue: (.+)$`,
110-
'u',
111-
);
107+
const simpleRegex = new RegExp(`^[✘] Test "(.+)"${OPTIONAL_AKA} recorded an issue: (.+)$`, 'u');
112108
const simpleMatch = line.match(simpleRegex);
113109
if (simpleMatch) {
114110
const [, rawTestName, message] = simpleMatch;

0 commit comments

Comments
 (0)