Chapter 11: UserTests.swift

Hi,
I’m getting this error message: Instance member ‘reset’ cannot be used on type ‘Application’; did you mean to use a value of this type instead?
Code is as below. Can you please help?

@testable import App
import Vapor
import XCTest
import FluentPostgreSQL

final class UserTests: XCTestCase {

let usersName = "Alice"
let usersUsername = "alicea"
let usersURI = "/api/users/"
var app: Application!
var conn: PostgreSQLConnection!

override func setUp() {
    try! Application.reset()
    app = try! Application.testable()
    conn = try! app.newConnection(to: .psql).wait()
}

//

@0xtim Can you please help with this when you get a chance? Thank you - much appreciated! :]

Hi,
I closed everything down, deleted both prod and test Postgres databases, then recreated everything and it all worked fine.

Thanks for a great book.
Peter

1 Like

@dotanuki-san Glad you sorted it out! Cheers! :]