Created
April 25, 2018 05:45
-
-
Save Cellane/03c7b7546212f3138d4bfe02a413cabd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Application+Testing.swift | |
// AppTests | |
// | |
// Created by Ondrej Rafaj on 27/02/2018. | |
// | |
import Foundation | |
import AppVaporTestTools | |
import Vapor | |
import VaporTestTools | |
extension TestableProperty where TestableType: Application { | |
public static func newTestApp() -> Application { | |
var env = Environment.testing | |
let app = new({ (config, _, services) in | |
try! AppVaporTestTools.configure(&config, &env, &services) | |
}) { (router) in | |
} | |
try! AppVaporTestTools.boot(app) | |
return app | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment