Skip to content

Commit 54ba264

Browse files
committed
test(nx-plugin): add parser configuration for tests
1 parent 7ce9e42 commit 54ba264

File tree

3 files changed

+72
-3
lines changed

3 files changed

+72
-3
lines changed

packages/nx-plugin/src/executors/update-api/updateApi.spec.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,30 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => {
2727
config: {
2828
input: config?.input ?? 'default-input',
2929
output: config?.output ?? 'default-output',
30-
parser: { validate_EXPERIMENTAL: true },
30+
parser: {
31+
pagination: {
32+
keywords: [
33+
'after',
34+
'before',
35+
'cursor',
36+
'offset',
37+
'page',
38+
'start',
39+
],
40+
},
41+
transforms: {
42+
enums: {
43+
case: 'PascalCase',
44+
enabled: false,
45+
mode: 'root',
46+
name: (n: string) => n,
47+
},
48+
readWrite: {
49+
enabled: false,
50+
},
51+
},
52+
validate_EXPERIMENTAL: true,
53+
},
3154
plugins: config?.plugins ?? [],
3255
},
3356
errors: [],

packages/nx-plugin/src/generators/openapi-client/openapiClient.spec.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,30 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => {
3737
config: {
3838
input: config?.input ?? 'default-input',
3939
output: config?.output ?? 'default-output',
40-
parser: { validate_EXPERIMENTAL: true },
40+
parser: {
41+
pagination: {
42+
keywords: [
43+
'after',
44+
'before',
45+
'cursor',
46+
'offset',
47+
'page',
48+
'start',
49+
],
50+
},
51+
transforms: {
52+
enums: {
53+
case: 'PascalCase',
54+
enabled: false,
55+
mode: 'root',
56+
name: (n: string) => n,
57+
},
58+
readWrite: {
59+
enabled: false,
60+
},
61+
},
62+
validate_EXPERIMENTAL: true,
63+
},
4164
plugins: config?.plugins ?? [],
4265
},
4366
errors: [],

packages/nx-plugin/src/utils.spec.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,30 @@ vi.mock('@hey-api/openapi-ts/internal', async (importOriginal) => {
5353
config: {
5454
input: config?.input ?? 'default-input',
5555
output: config?.output ?? 'default-output',
56-
parser: { validate_EXPERIMENTAL: true },
56+
parser: {
57+
pagination: {
58+
keywords: [
59+
'after',
60+
'before',
61+
'cursor',
62+
'offset',
63+
'page',
64+
'start',
65+
],
66+
},
67+
transforms: {
68+
enums: {
69+
case: 'PascalCase',
70+
enabled: false,
71+
mode: 'root',
72+
name: (n: string) => n,
73+
},
74+
readWrite: {
75+
enabled: false,
76+
},
77+
},
78+
validate_EXPERIMENTAL: true,
79+
},
5780
plugins: config?.plugins ?? [],
5881
},
5982
errors: [],

0 commit comments

Comments
 (0)