Skip to content

Commit 7e4c5a2

Browse files
committed
Fix test
1 parent 9b4bc3b commit 7e4c5a2

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

pkgs/typed-api-spec/src/msw/http.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { describe, it, expect, vi } from "vitest";
2-
import { http, HttpResponse } from "msw";
2+
import { HttpResponse } from "msw";
33
import { setupServer } from "msw/node";
4-
import { Http, HttpResponse as HttpResponseT, newHttp } from "./index";
5-
import { ApiP, DefineApiEndpoints } from "../core";
4+
import { HttpResponse as HttpResponseT, newHttp } from "./index";
5+
import { ApiP } from "../core";
66
import { z } from "zod";
77
import { ApiEndpointsSchema, ToApiEndpoints } from "../core";
88

pkgs/typed-api-spec/src/msw/index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,13 @@ export const newHttp = <
120120
baseUrl: BaseUrl,
121121
endpoints: ES,
122122
): Http<BaseUrl, ES> => {
123-
const { req, res } = newValidator(endpoints);
123+
const { req } = newValidator(endpoints);
124124
return new Proxy(http, {
125125
get(target, prop, receiver) {
126-
// o is the original method of the provided router
127126
const requestHandler = Reflect.get(target, prop, receiver);
128-
// if (prop === "all") {
129-
// return requestHandler;
130-
// }
127+
if (prop === "all") {
128+
return requestHandler;
129+
}
131130
return <
132131
// FIXME: Record<string, string> should be PathParams<keyof Params>
133132
Params extends Record<string, string> = Record<string, string>,

0 commit comments

Comments
 (0)