-
Notifications
You must be signed in to change notification settings - Fork 4
Moved .forTesting() functions to new importable LambdaRuntimeTestUtils target #20
Conversation
…forTesting() and other testing utility code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. Thanks so much for contributing. Only small nits, to please my style of coding - that I haven't documented anywhere.
@@ -5,7 +5,7 @@ import NIOHTTP1 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can remove NIO
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!!!
Package.swift
Outdated
.testTarget(name: "LambdaRuntimeTests", dependencies: ["LambdaRuntime", "NIOTestUtils", "Logging"]) | ||
.target( | ||
name: "LambdaRuntimeTestUtils", | ||
dependencies: ["LambdaRuntime"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to add NIOHTTP1
here, since we use HTTPHeaders
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course!!
Package.swift
Outdated
name: "LambdaRuntimeTestUtils", | ||
dependencies: ["LambdaRuntime"] | ||
), | ||
.testTarget(name: "LambdaRuntimeTests", dependencies: ["LambdaRuntime", "NIOTestUtils", "Logging", "LambdaRuntimeTestUtils"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code beauty:
.testTarget(name: "LambdaRuntimeTests", dependencies: [
"LambdaRuntime",
"LambdaRuntimeTestUtils",
"NIOTestUtils",
"Logging",
])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair!
@@ -1,6 +1,7 @@ | |||
import Foundation | |||
import XCTest | |||
import NIO | |||
import LambdaRuntimeTestUtils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put below (3 times)
@testable import LambdaRuntime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
@@ -1,10 +1,9 @@ | |||
import NIO | |||
import NIOHTTP1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIOHTTP1
can be removed here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course! Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All requested changes have been made. Thanks @fabianfett !!!
By moving Environment.forTesting() and Invocation.forTesting() to a new build target, these functions can now be used in your own unit tests when developing Lambda functions in Swift.