Skip to content

Commit 874ecb3

Browse files
fengmk2claude
andauthored
chore(deps): replace supertest with @eggjs/supertest (#5483)
Replace the external supertest dependency with the internal @eggjs/supertest package across the monorepo. This change uses the workspace's own supertest implementation instead of the external package. - Remove supertest and @types/supertest from pnpm catalog - Update package.json files in koa and egg-bin packages - Update all import statements from 'supertest' to '@eggjs/supertest' 🤖 Generated with [Claude Code](https://claude.ai/code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - Chores - Migrated HTTP testing client to internal @eggjs/supertest across the workspace. - Removed external supertest and its type definitions from workspace configuration and package dependencies. - Tests - Updated test suites to import the request helper from @eggjs/supertest. - No changes to test behavior or assertions; execution remains the same. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3af666f commit 874ecb3

File tree

20 files changed

+43
-129
lines changed

20 files changed

+43
-129
lines changed

packages/koa/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@
8080
"@types/on-finished": "catalog:",
8181
"@types/parseurl": "catalog:",
8282
"@types/statuses": "catalog:",
83-
"@types/supertest": "catalog:",
83+
"@eggjs/supertest": "workspace:*",
8484
"@types/type-is": "catalog:",
8585
"@types/vary": "catalog:",
8686
"mm": "catalog:",
87-
"supertest": "catalog:",
8887
"tsdown": "catalog:",
8988
"typescript": "catalog:"
9089
}

packages/koa/test/application/context.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict';
22
import { describe, it } from 'vitest';
33

4-
import request from 'supertest';
4+
import { request } from '@eggjs/supertest';
55

66
import { Application, Context } from '../../src/index.ts';
77

packages/koa/test/application/currentContext.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict';
22
import { describe, it } from 'vitest';
33

4-
import request from 'supertest';
4+
import { request } from '@eggjs/supertest';
55
import Koa from '../../src/index.ts';
66

77
describe('app.currentContext', () => {

packages/koa/test/application/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, it } from 'vitest';
33
import type { ServerResponse, IncomingMessage } from 'node:http';
44
import { once } from 'node:events';
55

6-
import request from 'supertest';
6+
import { request } from '@eggjs/supertest';
77
import createHttpError, { HttpError } from 'http-errors';
88

99
import Koa from '../../src/index.ts';

packages/koa/test/application/request.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict';
22
import { describe, it } from 'vitest';
33

4-
import request from 'supertest';
4+
import { request } from '@eggjs/supertest';
55

66
import Koa from '../../src/index.ts';
77

packages/koa/test/application/respond.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe, it } from 'vitest';
33
import fs from 'node:fs';
44
import { scheduler } from 'node:timers/promises';
55

6-
import request from 'supertest';
6+
import { request } from '@eggjs/supertest';
77
import statuses from 'statuses';
88

99
import Koa from '../../src/index.ts';

packages/koa/test/application/response.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict';
22
import { describe, it } from 'vitest';
33

4-
import request from 'supertest';
4+
import { request } from '@eggjs/supertest';
55

66
import Koa from '../../src/index.ts';
77

packages/koa/test/application/use.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict';
22
import { describe, it } from 'vitest';
33

4-
import request from 'supertest';
4+
import { request } from '@eggjs/supertest';
55

66
import Koa, { type MiddlewareFunc } from '../../src/index.ts';
77

packages/koa/test/context/cookies.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import assert from 'node:assert/strict';
22
import { describe, it } from 'vitest';
33

4-
import request from 'supertest';
4+
import { request } from '@eggjs/supertest';
55

66
import Koa, { type Context } from '../../src/index.ts';
77

packages/koa/test/context/onerror.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { once } from 'node:events';
55

66
import { describe, it } from 'vitest';
77

8-
import request from 'supertest';
8+
import { request } from '@eggjs/supertest';
99

1010
import Koa, { type Context } from '../../src/index.ts';
1111
import context from '../test-helpers/context.ts';

0 commit comments

Comments
 (0)