Skip to content

Commit 25aa799

Browse files
authored
Merge pull request #4 from BinaryBirds/dev
Version 1.1.1
2 parents 4c1cd5e + 77fe6c3 commit 25aa799

File tree

11 files changed

+1308
-1328
lines changed

11 files changed

+1308
-1328
lines changed

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,10 @@ In your project folder run:
2121
* for JUNIT format: `swift test | testify junit`
2222
* for MD format: `swift test | testify md`
2323

24-
If no argument or wrong argument added then output format fallbacks to JSON!
25-
2624
You can just use the [Swift Package Manager](https://theswiftdev.com/2017/11/09/swift-package-manager-tutorial/) as usual:
2725

2826
```swift
29-
.package(url: "https://github.com/binarybirds/testify", from: "1.1.0"),
27+
.package(url: "https://github.com/binarybirds/testify", from: "1.1.1"),
3028
```
3129

3230
⚠️ Don't forget to add "Testify" to your target as a dependency!

Sources/TestifySDK/Codable/TestResultMarkdownEncoder.swift

+5-19
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,19 @@ public struct TestResultMarkdownEncoder: TestResultEncoder {
2525
let successCount = suite.cases.reduce(0) { $0 + ($1.outcome == .success ? 1 : 0) }
2626
let failureCount = suite.cases.reduce(0) { $0 + ($1.outcome == .failure ? 1 : 0) }
2727

28-
result += "\(name): \(count) tests were completed in \(time) with \(successCount) passed, \(failureCount) failed and \(0) skipped.\n\n"
29-
result += "| Test case | Passed | Failed | Skipped | Time |\n"
30-
result += "| :--- | ---: | ---: | ---: | ---: |\n"
28+
result += "\(name): \(count) tests were completed in \(time) with \(successCount) passed, \(failureCount) failed.\n\n"
29+
result += "| Test case | Result | Time |\n"
30+
result += "| :--- | ---: | ---: |\n"
3131

3232
for testCase in suite.cases {
3333
let name = testCase.testName
34-
let passed = testCase.outcome == .success ? "" : ""
35-
let failed = testCase.outcome == .failure ? "" : ""
36-
let skipped = "🔀"
34+
let testResult = testCase.outcome == .success ? "" : ""
3735
let time = "\(testCase.duration)s ⌛️"
38-
result += "| \(name) | \(passed) | \(failed) | \(skipped) | \(time) |\n"
36+
result += "| \(name) | \(testResult) | \(time) |\n"
3937
}
4038

4139
}
4240

4341
return result
4442
}
4543
}
46-
47-
/*
48-
| git status lorem ipsum dolor sit amet | git status | git status | 0 | 12.32s |
49-
| git diff | git diff | git diff | 0 | 123.323s |
50-
| git diff | git diff | git diff | 0 | 123.323s |
51-
| git diff | git diff | git diff | 0 | 123.323s |
52-
| [git diff](Sources/test/test.swift#L4) | git diff ✅ | git diff ❌ | 0 🔀 | 123.323s ⌛️ |
53-
| git diff | git diff ✅ | git diff ❌ | 0 🔀 | 123.323s ⌛️ |
54-
| git diff | git diff ✅ | git diff ❌ | 0 🔀 | 123.323s ⌛️ |
55-
| git diff | git diff ✅ | git diff ❌ | 0 🔀 | 123.323s ⌛️ |
56-
| git diff | git diff ✅ | git diff ❌ | 0 🔀 | 123.323s ⌛️ |
57-
*/

Sources/testify/main.swift

+2-6
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@ import TestifySDK
1010

1111
let args = CommandLine.arguments
1212
var format: String = OutputFormat.json.rawValue
13-
let msg = "Testify output format is"
1413
if (args.count >= 2) {
1514
if let enumCase = OutputFormat(rawValue: args[1]) {
1615
format = enumCase.rawValue
17-
print(msg, "'\(format)'")
1816
} else {
19-
print("Unknown Testify output format, the format is 'json' for now. Available formats: 'json', 'junit', 'md'")
17+
fatalError("Error: Unknown output format. Available formats: 'json', 'junit', 'md'")
2018
}
21-
} else {
22-
print(msg, "'json'")
2319
}
2420

2521
var data: Data
@@ -50,5 +46,5 @@ case OutputFormat.md.rawValue:
5046
print(mdData)
5147

5248
default:
53-
print("Unknown output format")
49+
fatalError("Error: Unknown output format")
5450
}

Tests/Assets/md/Alamofire.md

+778-778
Large diffs are not rendered by default.

Tests/Assets/md/Kitura.md

+360-360
Large diffs are not rendered by default.

Tests/Assets/md/PromiseFailure.md

+120-120
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,120 @@
1-
ExecutionContextTests: 6 tests were completed in 18.541 with 6 passed, 0 failed and 0 skipped.
2-
3-
| Test case | Passed | Failed | Skipped | Time |
4-
| :--- | ---: | ---: | ---: | ---: |
5-
| testConcurrency || | 🔀 | 15.354s ⌛️ |
6-
| testInvalidatableQueueSupportsNonMainQueues || | 🔀 | 0.002s ⌛️ |
7-
| testInvalidatedInvalidatableQueue || | 🔀 | 0.102s ⌛️ |
8-
| testNonInvalidatedInvalidatableQueue || | 🔀 | 0.007s ⌛️ |
9-
| testTapContinuesToFireInvalidatableQueue || | 🔀 | 0.001s ⌛️ |
10-
| testThreads || | 🔀 | 3.075s ⌛️ |
11-
12-
PromiseAllTests: 5 tests were completed in 0.271 with 5 passed, 0 failed and 0 skipped.
13-
14-
| Test case | Passed | Failed | Skipped | Time |
15-
| :--- | ---: | ---: | ---: | ---: |
16-
| testAll || | 🔀 | 0.108s ⌛️ |
17-
| testAllWithEmptyArray || | 🔀 | 0.001s ⌛️ |
18-
| testAllWithPreFulfilledValues || | 🔀 | 0.001s ⌛️ |
19-
| testAllWithRejectionHappeningFirst || | 🔀 | 0.058s ⌛️ |
20-
| testAllWithRejectionHappeningLast || | 🔀 | 0.103s ⌛️ |
21-
22-
PromiseAlwaysTests: 4 tests were completed in 1.024 with 4 passed, 0 failed and 0 skipped.
23-
24-
| Test case | Passed | Failed | Skipped | Time |
25-
| :--- | ---: | ---: | ---: | ---: |
26-
| testAlways || | 🔀 | 0.507s ⌛️ |
27-
| testAlwaysInstantFulfill || | 🔀 | 0.001s ⌛️ |
28-
| testAlwaysInstantReject || | 🔀 | 0.001s ⌛️ |
29-
| testAlwaysRejects || | 🔀 | 0.515s ⌛️ |
30-
31-
PromiseDelayTests: 4 tests were completed in 0.9360000000000002 with 4 passed, 0 failed and 0 skipped.
32-
33-
| Test case | Passed | Failed | Skipped | Time |
34-
| :--- | ---: | ---: | ---: | ---: |
35-
| testDelay || | 🔀 | 0.202s ⌛️ |
36-
| testTimeoutFunctionFails || | 🔀 | 0.519s ⌛️ |
37-
| testTimeoutFunctionSucceeds || | 🔀 | 0.012s ⌛️ |
38-
| testTimeoutPromise || | 🔀 | 0.203s ⌛️ |
39-
40-
PromiseEnsureTests: 3 tests were completed in 0.003 with 3 passed, 0 failed and 0 skipped.
41-
42-
| Test case | Passed | Failed | Skipped | Time |
43-
| :--- | ---: | ---: | ---: | ---: |
44-
| testEnsureOnlyCalledOnSucceess || | 🔀 | 0.001s ⌛️ |
45-
| testEnsureRejects || | 🔀 | 0.001s ⌛️ |
46-
| testEnsureSucceeds || | 🔀 | 0.001s ⌛️ |
47-
48-
PromiseKickoffTests: 3 tests were completed in 0.104 with 3 passed, 0 failed and 0 skipped.
49-
50-
| Test case | Passed | Failed | Skipped | Time |
51-
| :--- | ---: | ---: | ---: | ---: |
52-
| testFailingKickoff || | 🔀 | 0.001s ⌛️ |
53-
| testKickoff || | 🔀 | 0.001s ⌛️ |
54-
| testPromiseKickoff || | 🔀 | 0.102s ⌛️ |
55-
56-
PromiseRaceTests: 4 tests were completed in 0.111 with 4 passed, 0 failed and 0 skipped.
57-
58-
| Test case | Passed | Failed | Skipped | Time |
59-
| :--- | ---: | ---: | ---: | ---: |
60-
| testInstantReject || | 🔀 | 0.001s ⌛️ |
61-
| testInstantResolve || | 🔀 | 0.001s ⌛️ |
62-
| testRace || | 🔀 | 0.056s ⌛️ |
63-
| testRaceFailure || | 🔀 | 0.053s ⌛️ |
64-
65-
PromiseRecoverTests: 6 tests were completed in 0.423 with 6 passed, 0 failed and 0 skipped.
66-
67-
| Test case | Passed | Failed | Skipped | Time |
68-
| :--- | ---: | ---: | ---: | ---: |
69-
| testIgnoreRecover || | 🔀 | 0.107s ⌛️ |
70-
| testIgnoreRecoverInstant || | 🔀 | 0.001s ⌛️ |
71-
| testRecover || | 🔀 | 0.105s ⌛️ |
72-
| testRecoverInstant || | 🔀 | 0.001s ⌛️ |
73-
| testRecoverWithThrowingFunction || | 🔀 | 0.106s ⌛️ |
74-
| testRecoverWithThrowingFunctionError || | 🔀 | 0.103s ⌛️ |
75-
76-
PromiseRetryTests: 3 tests were completed in 0.005 with 3 passed, 0 failed and 0 skipped.
77-
78-
| Test case | Passed | Failed | Skipped | Time |
79-
| :--- | ---: | ---: | ---: | ---: |
80-
| testRetry || | 🔀 | 0.002s ⌛️ |
81-
| testRetryWithInstantSuccess || | 🔀 | 0.001s ⌛️ |
82-
| testRetryWithNeverSuccess || | 🔀 | 0.002s ⌛️ |
83-
84-
PromiseTests: 17 tests were completed in 0.503 with 16 passed, 1 failed and 0 skipped.
85-
86-
| Test case | Passed | Failed | Skipped | Time |
87-
| :--- | ---: | ---: | ---: | ---: |
88-
| testAsync || | 🔀 | 0.056s ⌛️ |
89-
| testAsyncRejection || | 🔀 | 0.052s ⌛️ |
90-
| testAsyncThrowing || | 🔀 | 0.002s ⌛️ |
91-
| testDoubleReject || | 🔀 | 0.001s ⌛️ |
92-
| testDoubleResolve || | 🔀 | 0.001s ⌛️ |
93-
| testFlatMap || | 🔀 | 0.108s ⌛️ |
94-
| testFulfilled || | 🔀 | 0.053s ⌛️ |
95-
| testMap || | 🔀 | 0.001s ⌛️ |
96-
| testPending || | 🔀 | 0.001s ⌛️ |
97-
| testRejected || | 🔀 | 0.001s ⌛️ |
98-
| testRejectedAfterFulfilled || | 🔀 | 0.051s ⌛️ |
99-
| testRejectThenResolve || | 🔀 | 0.001s ⌛️ |
100-
| testResolveThenReject || | 🔀 | 0.001s ⌛️ |
101-
| testThen || | 🔀 | 0.001s ⌛️ |
102-
| testThenWhenPending || | 🔀 | 0.054s ⌛️ |
103-
| testTrailingClosuresCompile || | 🔀 | 0.107s ⌛️ |
104-
| testZalgoContained | || 🔀 | 0.012s ⌛️ |
105-
106-
PromiseThrowsTests: 4 tests were completed in 0.004 with 4 passed, 0 failed and 0 skipped.
107-
108-
| Test case | Passed | Failed | Skipped | Time |
109-
| :--- | ---: | ---: | ---: | ---: |
110-
| testThrowsInFlatmapping || | 🔀 | 0.001s ⌛️ |
111-
| testThrowsInFlatmappingWithError || | 🔀 | 0.001s ⌛️ |
112-
| testThrowsInMapping || | 🔀 | 0.001s ⌛️ |
113-
| testThrowsInMappingWithError || | 🔀 | 0.001s ⌛️ |
114-
115-
PromiseZipTests: 2 tests were completed in 0.007 with 2 passed, 0 failed and 0 skipped.
116-
117-
| Test case | Passed | Failed | Skipped | Time |
118-
| :--- | ---: | ---: | ---: | ---: |
119-
| testMultipleParameters || | 🔀 | 0.001s ⌛️ |
120-
| testZipping2 || | 🔀 | 0.006s ⌛️ |
1+
ExecutionContextTests: 6 tests were completed in 18.541 with 6 passed, 0 failed.
2+
3+
| Test case | Result | Time |
4+
| :--- | ---: | ---: |
5+
| testConcurrency ||15.354s ⌛️ |
6+
| testInvalidatableQueueSupportsNonMainQueues ||0.002s ⌛️ |
7+
| testInvalidatedInvalidatableQueue ||0.102s ⌛️ |
8+
| testNonInvalidatedInvalidatableQueue ||0.007s ⌛️ |
9+
| testTapContinuesToFireInvalidatableQueue ||0.001s ⌛️ |
10+
| testThreads ||3.075s ⌛️ |
11+
12+
PromiseAllTests: 5 tests were completed in 0.271 with 5 passed, 0 failed.
13+
14+
| Test case | Result | Time |
15+
| :--- | ---: | ---: |
16+
| testAll ||0.108s ⌛️ |
17+
| testAllWithEmptyArray ||0.001s ⌛️ |
18+
| testAllWithPreFulfilledValues ||0.001s ⌛️ |
19+
| testAllWithRejectionHappeningFirst ||0.058s ⌛️ |
20+
| testAllWithRejectionHappeningLast ||0.103s ⌛️ |
21+
22+
PromiseAlwaysTests: 4 tests were completed in 1.024 with 4 passed, 0 failed.
23+
24+
| Test case | Result | Time |
25+
| :--- | ---: | ---: |
26+
| testAlways ||0.507s ⌛️ |
27+
| testAlwaysInstantFulfill ||0.001s ⌛️ |
28+
| testAlwaysInstantReject ||0.001s ⌛️ |
29+
| testAlwaysRejects ||0.515s ⌛️ |
30+
31+
PromiseDelayTests: 4 tests were completed in 0.9360000000000002 with 4 passed, 0 failed.
32+
33+
| Test case | Result | Time |
34+
| :--- | ---: | ---: |
35+
| testDelay ||0.202s ⌛️ |
36+
| testTimeoutFunctionFails ||0.519s ⌛️ |
37+
| testTimeoutFunctionSucceeds ||0.012s ⌛️ |
38+
| testTimeoutPromise ||0.203s ⌛️ |
39+
40+
PromiseEnsureTests: 3 tests were completed in 0.003 with 3 passed, 0 failed.
41+
42+
| Test case | Result | Time |
43+
| :--- | ---: | ---: |
44+
| testEnsureOnlyCalledOnSucceess ||0.001s ⌛️ |
45+
| testEnsureRejects ||0.001s ⌛️ |
46+
| testEnsureSucceeds ||0.001s ⌛️ |
47+
48+
PromiseKickoffTests: 3 tests were completed in 0.104 with 3 passed, 0 failed.
49+
50+
| Test case | Result | Time |
51+
| :--- | ---: | ---: |
52+
| testFailingKickoff ||0.001s ⌛️ |
53+
| testKickoff ||0.001s ⌛️ |
54+
| testPromiseKickoff ||0.102s ⌛️ |
55+
56+
PromiseRaceTests: 4 tests were completed in 0.111 with 4 passed, 0 failed.
57+
58+
| Test case | Result | Time |
59+
| :--- | ---: | ---: |
60+
| testInstantReject ||0.001s ⌛️ |
61+
| testInstantResolve ||0.001s ⌛️ |
62+
| testRace ||0.056s ⌛️ |
63+
| testRaceFailure ||0.053s ⌛️ |
64+
65+
PromiseRecoverTests: 6 tests were completed in 0.423 with 6 passed, 0 failed.
66+
67+
| Test case | Result | Time |
68+
| :--- | ---: | ---: |
69+
| testIgnoreRecover ||0.107s ⌛️ |
70+
| testIgnoreRecoverInstant ||0.001s ⌛️ |
71+
| testRecover ||0.105s ⌛️ |
72+
| testRecoverInstant ||0.001s ⌛️ |
73+
| testRecoverWithThrowingFunction ||0.106s ⌛️ |
74+
| testRecoverWithThrowingFunctionError ||0.103s ⌛️ |
75+
76+
PromiseRetryTests: 3 tests were completed in 0.005 with 3 passed, 0 failed.
77+
78+
| Test case | Result | Time |
79+
| :--- | ---: | ---: |
80+
| testRetry ||0.002s ⌛️ |
81+
| testRetryWithInstantSuccess ||0.001s ⌛️ |
82+
| testRetryWithNeverSuccess ||0.002s ⌛️ |
83+
84+
PromiseTests: 17 tests were completed in 0.503 with 16 passed, 1 failed.
85+
86+
| Test case | Result | Time |
87+
| :--- | ---: | ---: |
88+
| testAsync ||0.056s ⌛️ |
89+
| testAsyncRejection ||0.052s ⌛️ |
90+
| testAsyncThrowing ||0.002s ⌛️ |
91+
| testDoubleReject ||0.001s ⌛️ |
92+
| testDoubleResolve ||0.001s ⌛️ |
93+
| testFlatMap ||0.108s ⌛️ |
94+
| testFulfilled ||0.053s ⌛️ |
95+
| testMap ||0.001s ⌛️ |
96+
| testPending ||0.001s ⌛️ |
97+
| testRejected ||0.001s ⌛️ |
98+
| testRejectedAfterFulfilled ||0.051s ⌛️ |
99+
| testRejectThenResolve ||0.001s ⌛️ |
100+
| testResolveThenReject ||0.001s ⌛️ |
101+
| testThen ||0.001s ⌛️ |
102+
| testThenWhenPending ||0.054s ⌛️ |
103+
| testTrailingClosuresCompile ||0.107s ⌛️ |
104+
| testZalgoContained | | 0.012s ⌛️ |
105+
106+
PromiseThrowsTests: 4 tests were completed in 0.004 with 4 passed, 0 failed.
107+
108+
| Test case | Result | Time |
109+
| :--- | ---: | ---: |
110+
| testThrowsInFlatmapping ||0.001s ⌛️ |
111+
| testThrowsInFlatmappingWithError ||0.001s ⌛️ |
112+
| testThrowsInMapping ||0.001s ⌛️ |
113+
| testThrowsInMappingWithError ||0.001s ⌛️ |
114+
115+
PromiseZipTests: 2 tests were completed in 0.007 with 2 passed, 0 failed.
116+
117+
| Test case | Result | Time |
118+
| :--- | ---: | ---: |
119+
| testMultipleParameters ||0.001s ⌛️ |
120+
| testZipping2 ||0.006s ⌛️ |
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PromiseTests: 1 tests were completed in 0.021 with 0 passed, 1 failed and 0 skipped.
1+
PromiseTests: 1 tests were completed in 0.021 with 0 passed, 1 failed.
22

3-
| Test case | Passed | Failed | Skipped | Time |
4-
| :--- | ---: | ---: | ---: | ---: |
5-
| testUnexpected | || 🔀 | 0.021s ⌛️ |
3+
| Test case | Result | Time |
4+
| :--- | ---: | ---: |
5+
| testUnexpected | | 0.021s ⌛️ |

Tests/Assets/md/Shell.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
ShellTests: 6 tests were completed in 2.497 with 6 passed, 0 failed and 0 skipped.
1+
ShellTests: 6 tests were completed in 2.497 with 6 passed, 0 failed.
22

3-
| Test case | Passed | Failed | Skipped | Time |
4-
| :--- | ---: | ---: | ---: | ---: |
5-
| testAsyncRun || | 🔀 | 2.172s ⌛️ |
6-
| testEnvironment || | 🔀 | 0.065s ⌛️ |
7-
| testError || | 🔀 | 0.065s ⌛️ |
8-
| testErrorHandler || | 🔀 | 0.066s ⌛️ |
9-
| testOutput || | 🔀 | 0.065s ⌛️ |
10-
| testOutputHandler || | 🔀 | 0.064s ⌛️ |
3+
| Test case | Result | Time |
4+
| :--- | ---: | ---: |
5+
| testAsyncRun ||2.172s ⌛️ |
6+
| testEnvironment ||0.065s ⌛️ |
7+
| testError ||0.065s ⌛️ |
8+
| testErrorHandler ||0.066s ⌛️ |
9+
| testOutput ||0.065s ⌛️ |
10+
| testOutputHandler ||0.064s ⌛️ |

Tests/Assets/md/ShellFailure.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
ShellTests: 7 tests were completed in 2.532 with 4 passed, 3 failed and 0 skipped.
1+
ShellTests: 7 tests were completed in 2.532 with 4 passed, 3 failed.
22

3-
| Test case | Passed | Failed | Skipped | Time |
4-
| :--- | ---: | ---: | ---: | ---: |
5-
| testAsyncRun || | 🔀 | 2.143s ⌛️ |
6-
| testEnvironment | || 🔀 | 0.067s ⌛️ |
7-
| testError || | 🔀 | 0.064s ⌛️ |
8-
| testErrorHandler || | 🔀 | 0.064s ⌛️ |
9-
| testOutput | || 🔀 | 0.064s ⌛️ |
10-
| testOutputHandler || | 🔀 | 0.064s ⌛️ |
11-
| testThrow | || 🔀 | 0.066s ⌛️ |
3+
| Test case | Result | Time |
4+
| :--- | ---: | ---: |
5+
| testAsyncRun ||2.143s ⌛️ |
6+
| testEnvironment | | 0.067s ⌛️ |
7+
| testError ||0.064s ⌛️ |
8+
| testErrorHandler ||0.064s ⌛️ |
9+
| testOutput | | 0.064s ⌛️ |
10+
| testOutputHandler ||0.064s ⌛️ |
11+
| testThrow | | 0.066s ⌛️ |

0 commit comments

Comments
 (0)