Skip to content

Commit cef7572

Browse files
committed
chore: fix test cases
1 parent 50da400 commit cef7572

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

packages/server/bff-core/tests/client/__snapshots__/generateClient.test.ts.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`client generateClient should support cross croject invocation 1`] = `
4-
"import { createRequest } from '@modern-js/plugin-bff/runtime/create-request';
4+
"import { createRequest } from '@modern-js/plugin-bff/client';
55
6-
export var DELETE = createRequest({path: '/normal/origin',method: 'DELETE',port: 3000,httpMethodDecider: 'functionName', requestId: 'tests'});
7-
export default createRequest({path: '/normal/origin',method: 'GET',port: 3000,httpMethodDecider: 'functionName', requestId: 'tests'});
8-
export var putRepo = createRequest({path: '/put-repo',method: 'PUT',port: 3000,httpMethodDecider: 'functionName', requestId: 'tests'});
6+
export var DELETE = createRequest({path: '/normal/origin',method: 'DELETE',port: 3000,httpMethodDecider: 'functionName', requestId: '@modern-js/bff-core'});
7+
export default createRequest({path: '/normal/origin',method: 'GET',port: 3000,httpMethodDecider: 'functionName', requestId: '@modern-js/bff-core'});
8+
export var putRepo = createRequest({path: '/put-repo',method: 'PUT',port: 3000,httpMethodDecider: 'functionName', requestId: '@modern-js/bff-core'});
99
"
1010
`;
1111

1212
exports[`client generateClient should support operator 1`] = `
13-
"import { createRequest } from '@modern-js/plugin-bff/runtime/create-request';
13+
"import { createRequest } from '@modern-js/plugin-bff/client';
1414
1515
export var DELETE = createRequest({path: '/normal/origin',method: 'DELETE',port: 3000,httpMethodDecider: 'functionName'});
1616
export default createRequest({path: '/normal/origin',method: 'GET',port: 3000,httpMethodDecider: 'functionName'});
@@ -19,7 +19,7 @@ export var DELETE = createRequest({path: '/normal/origin',method: 'DELETE',port:
1919
`;
2020

2121
exports[`client generateClient should works correctly 1`] = `
22-
"import { createRequest } from '@modern-js/plugin-bff/runtime/create-request';
22+
"import { createRequest } from '@modern-js/plugin-bff/client';
2323
2424
export var get = createRequest({path: '/api/:id/origin/foo',method: 'GET',port: 3000,httpMethodDecider: 'functionName'});
2525
export var post = createRequest({path: '/api/:id/origin/foo',method: 'POST',port: 3000,httpMethodDecider: 'functionName'});

packages/server/bff-core/tests/client/generateClient.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ describe('client', () => {
2626
const source = await fs.readFile(resourcePath, 'utf-8');
2727

2828
const result = await generateClient({
29+
appDir: PWD,
2930
prefix,
3031
port,
3132
resourcePath,
@@ -48,6 +49,7 @@ describe('client', () => {
4849
const source = await fs.readFile(resourcePath, 'utf-8');
4950

5051
const result = await generateClient({
52+
appDir: PWD,
5153
prefix,
5254
port,
5355
resourcePath,
@@ -70,6 +72,7 @@ describe('client', () => {
7072
const source = await fs.readFile(resourcePath, 'utf-8');
7173

7274
const result = await generateClient({
75+
appDir: PWD,
7376
prefix,
7477
port,
7578
resourcePath,

0 commit comments

Comments
 (0)