Skip to content

Instantly share code, notes, and snippets.

@Cellane
Created April 25, 2018 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cellane/03c7b7546212f3138d4bfe02a413cabd to your computer and use it in GitHub Desktop.
Save Cellane/03c7b7546212f3138d4bfe02a413cabd to your computer and use it in GitHub Desktop.
//
// 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