Skip to content

Commit 5b9473a

Browse files
committed
test(mwcp): update url
1 parent dc2bd4c commit 5b9473a

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

packages/midway-component-fetch/test/10.fetch.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe(fileShortPath(import.meta.url), function () {
1111
it('Should work', async () => {
1212
const { httpRequest, app } = testConfig
1313

14-
const path = `${apiBase.prefix}/${apiMethod.ip}`
14+
const path = `${apiBase.fetch}/${apiMethod.ip}`
1515
const resp = await httpRequest
1616
.get(path)
1717

@@ -26,7 +26,7 @@ describe(fileShortPath(import.meta.url), function () {
2626
it.skip('Should work self', async () => {
2727
const { httpRequest } = testConfig
2828

29-
const path = `${apiBase.prefix}/${apiMethod.self}`
29+
const path = `${apiBase.fetch}/${apiMethod.self}`
3030
const resp = await httpRequest
3131
.get(path)
3232

packages/midway-component-fetch/test/fixtures/base-app/src/fetch.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@ import {
66
} from '@midwayjs/core'
77

88
import { FetchService } from '../../../../dist/index.js'
9+
import { apiBase, apiMethod } from '../../../api-test.js'
910

1011

11-
@Controller('/fetch')
12+
// @Controller('/fetch')
13+
@Controller(apiBase.fetch)
1214
export class FetchController {
1315

1416
@Inject() private readonly fetchService: FetchService
1517

16-
@Get('/ip')
18+
@Get(`/${apiMethod.ip}`)
1719
async ip(): Promise<string> {
1820
const url = 'http://ifconfig.me' // 222.233.10.1
1921

@@ -26,7 +28,7 @@ export class FetchController {
2628
return ip
2729
}
2830

29-
@Get('/self')
31+
@Get(`/${apiMethod.self}`)
3032
async self(): Promise<string> {
3133
const url = 'http://127.0.0.1:7002/fetch/hello'
3234
const text = await this.fetchService.get<string>(url, { dataType: 'text' })

0 commit comments

Comments
 (0)