@flink-app/test-utils 2.0.0-alpha.70 → 2.0.0-alpha.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/http.d.ts +2 -2
- package/package.json +2 -2
- package/src/http.ts +2 -2
package/CHANGELOG.md
CHANGED
package/dist/http.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlinkApp, FlinkResponse } from "@flink-app/flink";
|
|
1
|
+
import { FlinkApp, FlinkContext, FlinkResponse } from "@flink-app/flink";
|
|
2
2
|
export type HttpOpts = {
|
|
3
3
|
/***
|
|
4
4
|
* Optional query string
|
|
@@ -26,7 +26,7 @@ export type HttpOpts = {
|
|
|
26
26
|
* Initializes test flink app.
|
|
27
27
|
* Must be invoked prior to using test HTTP methods.
|
|
28
28
|
*/
|
|
29
|
-
export declare function init(_app: FlinkApp<
|
|
29
|
+
export declare function init<C extends FlinkContext<any>>(_app: FlinkApp<C>, host?: string): void;
|
|
30
30
|
export declare function get<Res = any>(path: string, opts?: HttpOpts): Promise<FlinkResponse<Res>>;
|
|
31
31
|
export declare function post<Req = any, Res = any>(path: string, body: Req, opts?: HttpOpts): Promise<FlinkResponse<Res>>;
|
|
32
32
|
export declare function put<Req = any, Res = any>(path: string, body: Req, opts?: HttpOpts): Promise<FlinkResponse<Res>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flink-app/test-utils",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.71",
|
|
4
4
|
"description": "Test utils for Flink",
|
|
5
5
|
"author": "joel@frost.se",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"jasmine-ts": "^0.3.3",
|
|
24
24
|
"ts-node": "^10.9.2",
|
|
25
25
|
"tsc-watch": "^4.2.9",
|
|
26
|
-
"@flink-app/flink": "2.0.0-alpha.
|
|
26
|
+
"@flink-app/flink": "2.0.0-alpha.71"
|
|
27
27
|
},
|
|
28
28
|
"gitHead": "4243e3b3cd6d4e1ca001a61baa8436bf2bbe4113",
|
|
29
29
|
"scripts": {
|
package/src/http.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FlinkApp, FlinkResponse } from "@flink-app/flink";
|
|
1
|
+
import { FlinkApp, FlinkContext, FlinkResponse } from "@flink-app/flink";
|
|
2
2
|
import got, { GotJSONOptions } from "got";
|
|
3
3
|
import qs from "qs";
|
|
4
4
|
|
|
@@ -34,7 +34,7 @@ export type HttpOpts = {
|
|
|
34
34
|
* Initializes test flink app.
|
|
35
35
|
* Must be invoked prior to using test HTTP methods.
|
|
36
36
|
*/
|
|
37
|
-
export function init(_app: FlinkApp<
|
|
37
|
+
export function init<C extends FlinkContext<any>>(_app: FlinkApp<C>, host = "localhost") {
|
|
38
38
|
app = _app;
|
|
39
39
|
baseUrl = `http://${host}:${app.port}`;
|
|
40
40
|
}
|