Skip to content

Commit 98af366

Browse files
committed
Fix type error
1 parent 9d77584 commit 98af366

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/sdk/src/server/__tests__/server.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -721,17 +721,17 @@ describe("BackendClient", () => {
721721
type ExpectRequest = {
722722
method?: string
723723
url?: string | RegExp
724-
json?: Record<string, never>
724+
json?: Record<string, unknown>
725725
headersContaining?: Record<string, string>
726726
}
727727
type MockResponse =
728728
| Response
729-
| { status?: number; json?: never }
729+
| { status?: number; json?: unknown }
730730
type IfOpts = {
731731
method: string
732732
url: string
733733
headers: Record<string, string> // NonNullable<RequestInit["headers"]>
734-
json?: never // body json
734+
json?: unknown // body json
735735
// XXX etc.
736736
}
737737
function setupFetchMock() {
@@ -740,7 +740,7 @@ function setupFetchMock() {
740740
response: () => Response
741741
}[] = []
742742

743-
const jsonResponse = (o: never, opts?: { status?: number }) => {
743+
const jsonResponse = (o: unknown, opts?: { status?: number }) => {
744744
return new Response(JSON.stringify(o), {
745745
status: opts?.status,
746746
headers: {
@@ -752,12 +752,12 @@ function setupFetchMock() {
752752
beforeEach(() => {
753753
intercepts = [];
754754
// without these generics this fails typecheck and can't figure out why
755-
jest.spyOn<never, never, never>(global, "fetch").mockImplementation(jest.fn<typeof fetch>(async (...args: Parameters<typeof fetch>) => {
755+
jest.spyOn<any, any, any>(global, "fetch").mockImplementation(jest.fn<typeof fetch>(async (...args: Parameters<typeof fetch>) => { // eslint-disable-line @typescript-eslint/no-explicit-any
756756
const [
757757
url,
758758
init,
759759
] = args
760-
let json: never
760+
let json: unknown
761761
if (init?.body && typeof init.body === "string") {
762762
try {
763763
json = JSON.parse(init.body)

0 commit comments

Comments
 (0)