remove AbsolutePath.exists
This commit is contained in:
parent
9c89fe7847
commit
a599a50532
|
@ -22,6 +22,8 @@ import XCTest
|
||||||
|
|
||||||
final class BundleCommandTests: XCTestCase {
|
final class BundleCommandTests: XCTestCase {
|
||||||
func testWithNoArguments() async throws {
|
func testWithNoArguments() async throws {
|
||||||
|
let fs = localFileSystem
|
||||||
|
|
||||||
try await withFixture("EchoExecutable") { packageDirectory in
|
try await withFixture("EchoExecutable") { packageDirectory in
|
||||||
let bundleDirectory = packageDirectory.appending(component: "Bundle")
|
let bundleDirectory = packageDirectory.appending(component: "Bundle")
|
||||||
|
|
||||||
|
@ -29,7 +31,7 @@ final class BundleCommandTests: XCTestCase {
|
||||||
try result.checkNonZeroExit()
|
try result.checkNonZeroExit()
|
||||||
|
|
||||||
// Confirm that the files are actually in the folder
|
// Confirm that the files are actually in the folder
|
||||||
XCTAssertTrue(bundleDirectory.exists, "The Bundle directory should exist")
|
XCTAssertTrue(fs.isDirectory(bundleDirectory), "The Bundle directory should exist")
|
||||||
XCTAssertTrue(bundleDirectory.ls().contains("index.html"), "Bundle does not have index.html")
|
XCTAssertTrue(bundleDirectory.ls().contains("index.html"), "Bundle does not have index.html")
|
||||||
XCTAssertFalse(
|
XCTAssertFalse(
|
||||||
(bundleDirectory.ls().filter { $0.contains("wasm") }).isEmpty,
|
(bundleDirectory.ls().filter { $0.contains("wasm") }).isEmpty,
|
||||||
|
|
|
@ -58,10 +58,6 @@ func withFixture(_ name: String, _ body: (AbsolutePath) async throws -> Void) as
|
||||||
}
|
}
|
||||||
|
|
||||||
extension AbsolutePath {
|
extension AbsolutePath {
|
||||||
var exists: Bool {
|
|
||||||
FileManager.default.fileExists(atPath: pathString)
|
|
||||||
}
|
|
||||||
|
|
||||||
func ls() -> [String] {
|
func ls() -> [String] {
|
||||||
guard let paths = try? FileManager.default.subpathsOfDirectory(atPath: pathString)
|
guard let paths = try? FileManager.default.subpathsOfDirectory(atPath: pathString)
|
||||||
else { return [] }
|
else { return [] }
|
||||||
|
|
Loading…
Reference in New Issue