Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Sources/XCTestHTMLReport/Classes/Models/Attachment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import XCResultKit

enum AttachmentType: String {
case unknwown = ""
case unknown = ""
case data = "public.data"
case html = "public.html"
case jpeg = "public.jpeg"
Expand Down Expand Up @@ -66,11 +66,11 @@ struct Attachment: HTML

init(attachment: ActionTestAttachment, file: ResultFile, padding: Int = 0) {
self.filename = attachment.filename ?? ""
self.type = AttachmentType(rawValue: attachment.uniformTypeIdentifier) ?? .unknwown
self.type = AttachmentType(rawValue: attachment.uniformTypeIdentifier) ?? .unknown
self.name = attachment.name.map(AttachmentName.init(rawValue:))
if let id = attachment.payloadRef?.id,
let url = file.exportPayload(id: id) {
self.path = url.relativePath
self.path = url.lastPathComponent
} else {
self.path = ""
}
Expand All @@ -83,7 +83,7 @@ struct Attachment: HTML
return "Screenshot"
case .text, .html, .data:
return "File"
case .unknwown:
case .unknown:
return "Attachment"
}
}
Expand All @@ -105,7 +105,7 @@ struct Attachment: HTML
return HTMLTemplates.screenshot
case .text, .html, .data:
return HTMLTemplates.text
case .unknwown:
case .unknown:
return ""
}
}
Expand Down
1 change: 0 additions & 1 deletion Sources/XCTestHTMLReport/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ let html = summary.html

do {
let path = result.values.first!
.dropLastPathComponent()
.addPathComponent("index.html")
Logger.substep("Writing report to \(path)")

Expand Down