Skip to content

Commit c9b3f9e

Browse files
Chase Coalwelltrivikr
authored andcommitted
fix: test to cover correct input (#748)
1 parent 25d0208 commit c9b3f9e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/middleware-sdk-machinelearning/src/predict-endpoint.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ describe("predictEndpointMiddleware", () => {
2727
request: { hostname, path, protocol }
2828
} = next.mock.calls[0][0];
2929

30+
expect(mockUrlParser.mock.calls[0][0]).toBe(
31+
"http://api.example.com/foo/bar"
32+
);
3033
expect(forwardedInput).toBe(input);
3134
expect(hostname).toBe("api.example.com");
3235
expect(path).toBe("/foo/bar");

packages/middleware-sdk-machinelearning/src/predict-endpoint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function predictEndpointMiddleware(
2222
let { request } = args;
2323
if (HttpRequest.isInstance(request)) {
2424
if (input.PredictEndpoint) {
25-
const endpoint = options.urlParser(input.predictEndpoint);
25+
const endpoint = options.urlParser(input.PredictEndpoint);
2626
request = {
2727
...request,
2828
hostname: endpoint.hostname,

0 commit comments

Comments
 (0)