Skip to content

Commit 3d08a14

Browse files
author
Penny[bot]
committed
Autogenerated from git://github.com/vapor/template.git@250d88a06073928485f33f5f71941ebe37a8abce
1 parent 0883664 commit 3d08a14

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ let package = Package(
88
],
99
dependencies: [
1010
// 💧 A server-side Swift web framework.
11-
.package(url: "https://github.com/vapor/vapor.git", from: "4.99.3"),
11+
.package(url: "https://github.com/vapor/vapor.git", from: "4.110.1"),
1212
// 🗄 An ORM for SQL and NoSQL databases.
1313
.package(url: "https://github.com/vapor/fluent.git", from: "4.9.0"),
1414
// 🐘 Fluent driver for Postgres.
@@ -32,7 +32,7 @@ let package = Package(
3232
name: "AppTests",
3333
dependencies: [
3434
.target(name: "App"),
35-
.product(name: "XCTVapor", package: "vapor"),
35+
.product(name: "VaporTesting", package: "vapor"),
3636
],
3737
swiftSettings: swiftSettings
3838
)

Tests/AppTests/AppTests.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@testable import App
2-
import XCTVapor
2+
import VaporTesting
33
import Testing
44
import Fluent
55

@@ -24,7 +24,7 @@ struct AppTests {
2424
@Test("Test Hello World Route")
2525
func helloWorld() async throws {
2626
try await withApp { app in
27-
try await app.test(.GET, "hello", afterResponse: { res async in
27+
try await app.testing().test(.GET, "hello", afterResponse: { res async in
2828
#expect(res.status == .ok)
2929
#expect(res.body.string == "Hello, world!")
3030
})
@@ -37,7 +37,7 @@ struct AppTests {
3737
let sampleTodos = [Todo(title: "sample1"), Todo(title: "sample2")]
3838
try await sampleTodos.create(on: app.db)
3939

40-
try await app.test(.GET, "todos", afterResponse: { res async throws in
40+
try await app.testing().test(.GET, "todos", afterResponse: { res async throws in
4141
#expect(res.status == .ok)
4242
#expect(try res.content.decode([TodoDTO].self) == sampleTodos.map { $0.toDTO()} )
4343
})
@@ -49,13 +49,12 @@ struct AppTests {
4949
let newDTO = TodoDTO(id: nil, title: "test")
5050

5151
try await withApp { app in
52-
try await app.test(.POST, "todos", beforeRequest: { req in
52+
try await app.testing().test(.POST, "todos", beforeRequest: { req in
5353
try req.content.encode(newDTO)
5454
}, afterResponse: { res async throws in
5555
#expect(res.status == .ok)
5656
let models = try await Todo.query(on: app.db).all()
5757
#expect(models.map({ $0.toDTO().title }) == [newDTO.title])
58-
XCTAssertEqual(models.map { $0.toDTO() }, [newDTO])
5958
})
6059
}
6160
}
@@ -67,7 +66,7 @@ struct AppTests {
6766
try await withApp { app in
6867
try await testTodos.create(on: app.db)
6968

70-
try await app.test(.DELETE, "todos/\(testTodos[0].requireID())", afterResponse: { res async throws in
69+
try await app.testing().test(.DELETE, "todos/\(testTodos[0].requireID())", afterResponse: { res async throws in
7170
#expect(res.status == .noContent)
7271
let model = try await Todo.find(testTodos[0].id, on: app.db)
7372
#expect(model == nil)

0 commit comments

Comments
 (0)