@flink-app/test-utils 2.0.0-alpha.70 → 2.0.0-alpha.72

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @flink-app/test-utils
2
2
 
3
+ ## 2.0.0-alpha.72
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(test-utils): accept typed FlinkApp instances in init() by casting internally
8
+
9
+ ## 2.0.0-alpha.71
10
+
11
+ ### Patch Changes
12
+
13
+ - fix(test-utils): make init() generic to accept typed FlinkApp instances
14
+
3
15
  ## 2.0.0-alpha.70
4
16
 
5
17
  ## 2.0.0-alpha.69
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<any>, host?: string): void;
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.70",
3
+ "version": "2.0.0-alpha.72",
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.70"
26
+ "@flink-app/flink": "2.0.0-alpha.72"
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,8 +34,8 @@ 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<any>, host = "localhost") {
38
- app = _app;
37
+ export function init<C extends FlinkContext<any>>(_app: FlinkApp<C>, host = "localhost") {
38
+ app = _app as unknown as FlinkApp<any>;
39
39
  baseUrl = `http://${host}:${app.port}`;
40
40
  }
41
41