@@ -721,17 +721,17 @@ describe("BackendClient", () => {
721721type ExpectRequest = {
722722 method ?: string
723723 url ?: string | RegExp
724- json ?: Record < string , never >
724+ json ?: Record < string , unknown >
725725 headersContaining ?: Record < string , string >
726726}
727727type MockResponse =
728728 | Response
729- | { status ?: number ; json ?: never }
729+ | { status ?: number ; json ?: unknown }
730730type 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}
737737function 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