Skip to content

Commit e49f3bb

Browse files
committed
fix(fetch): remove supertest fetch as it is unnecessary
in the scope of this library BREAKING CHANGE: no more supertest fetch
1 parent 96d0725 commit e49f3bb

File tree

4 files changed

+1188
-1168
lines changed

4 files changed

+1188
-1168
lines changed

__tests__/src/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { ServiceLocals } from '@openapi-typescript-infra/service';
2-
import { RestApiErrorResponse, RestApiSuccessResponse } from 'rest-api-support';
32

43
export interface FakeServLocals extends ServiceLocals {
54
services: {
65
fakeServ: {
7-
get_something(): Promise<RestApiSuccessResponse<{ things: string[] }> | RestApiErrorResponse>;
6+
get_something(): Promise<{ things: string[] }>;
87
}
98
}
109
}

package.json

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,35 +50,33 @@
5050
]
5151
},
5252
"devDependencies": {
53-
"@commitlint/cli": "^18.2.0",
54-
"@commitlint/config-conventional": "^18.1.0",
55-
"@openapi-typescript-infra/coconfig": "^4.2.2",
56-
"@openapi-typescript-infra/service": "^4.7.0",
53+
"@commitlint/cli": "^19.3.0",
54+
"@commitlint/config-conventional": "^19.2.2",
55+
"@openapi-typescript-infra/coconfig": "^4.3.0",
56+
"@openapi-typescript-infra/service": "^4.16.0",
5757
"@semantic-release/changelog": "^6.0.3",
58-
"@semantic-release/commit-analyzer": "^11.1.0",
58+
"@semantic-release/commit-analyzer": "^12.0.0",
5959
"@semantic-release/exec": "^6.0.3",
6060
"@semantic-release/git": "^10.0.1",
61-
"@semantic-release/release-notes-generator": "^12.1.0",
62-
"@typescript-eslint/eslint-plugin": "^6.10.0",
63-
"@typescript-eslint/parser": "^6.10.0",
64-
"@vitest/coverage-v8": "^0.34.6",
65-
"coconfig": "^1.0.0",
66-
"eslint-config-prettier": "^9.0.0",
67-
"eslint-plugin-import": "^2.29.0",
68-
"ts-node": "^10.9.1",
69-
"vitest": "^0.34.6"
61+
"@semantic-release/release-notes-generator": "^13.0.0",
62+
"@typescript-eslint/eslint-plugin": "^6.21.0",
63+
"@typescript-eslint/parser": "^6.21.0",
64+
"@vitest/coverage-v8": "1.3.1",
65+
"coconfig": "^1.5.2",
66+
"eslint-config-prettier": "^9.1.0",
67+
"eslint-plugin-import": "^2.29.1",
68+
"ts-node": "^10.9.2",
69+
"vitest": "1.3.1"
7070
},
7171
"dependencies": {
72-
"@types/supertest": "^2.0.15",
73-
"eslint": "^8.53.0",
72+
"@types/supertest": "^6.0.2",
73+
"eslint": "^8.57.0",
7474
"find-up": "^6.3.0",
75-
"pino-pretty": "^10.2.3",
75+
"pino-pretty": "^11.0.0",
7676
"read-pkg-up": "^7.0.1",
77-
"rest-api-support": "^1.16.3",
78-
"supertest": "^6.3.3",
79-
"supertest-fetch": "^1.5.0",
77+
"supertest": "^7.0.0",
8078
"tsconfig-paths": "^4.2.0",
81-
"typescript": "^5.2.2"
79+
"typescript": "^5.4.5"
8280
},
8381
"packageManager": "[email protected]"
8482
}

src/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import path from 'path';
22
import assert from 'assert';
33

44
import request from 'supertest';
5-
import { makeFetch } from 'supertest-fetch';
65
// We are going to test Typescript files, so use the ts-node
76
// register hook to allow require to resolve these modules
87
import { register } from 'ts-node';
@@ -101,19 +100,12 @@ async function readOptions<
101100
}
102101

103102
class RequestTestingHelpers {
104-
_fetch: ReturnType<typeof makeFetch>;
105-
106103
constructor(private app: ServiceExpress) {
107-
this._fetch = makeFetch(app as unknown as Parameters<typeof makeFetch>[0]);
108104
}
109105

110106
get request() {
111107
return request(this.app);
112108
}
113-
114-
get fetch() {
115-
return this._fetch as unknown as typeof fetch;
116-
}
117109
}
118110

119111
export interface ServiceUnderTest<

0 commit comments

Comments
 (0)