-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathvalidate.test.ts.snap
207 lines (166 loc) · 7.52 KB
/
validate.test.ts.snap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`rdme openapi validate > GHA onboarding E2E tests > should create GHA workflow if user passes in spec via opt (github flag enabled) 1`] = `
"
Your GitHub Actions workflow file has been created! ✨
Almost done! Push your newly created file (.github/workflows/validate-test-opt-spec-github-file.yml) to GitHub and you're all set 🚀
🦉 If you have any more questions, feel free to drop us a line! [email protected]
"
`;
exports[`rdme openapi validate > GHA onboarding E2E tests > should create GHA workflow if user passes in spec via opt (github flag enabled) 2`] = `
"# This GitHub Actions workflow was auto-generated by the \`rdme\` cli on 2022-01-01T00:00:00.000Z
# You can view our full documentation here: https://docs.readme.com/docs/rdme
name: ReadMe GitHub Action 🦉
on:
push:
branches:
# This workflow will run every time you push code to the following branch: \`validate-test-opt-spec-github-branch\`
# Check out GitHub's docs for more info on configuring this:
# https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
- validate-test-opt-spec-github-branch
jobs:
rdme-openapi-validate:
runs-on: ubuntu-latest
steps:
- name: Check out repo 📚
uses: actions/checkout@v4
- name: Run \`openapi validate\` command 🚀
uses: readmeio/rdme@v7
with:
rdme: openapi validate __tests__/__fixtures__/petstore-simple-weird-version.json
"
`;
exports[`rdme openapi validate > GHA onboarding E2E tests > should create GHA workflow if user passes in spec via opt (including workingDirectory) 1`] = `
"
Your GitHub Actions workflow file has been created! ✨
Almost done! Push your newly created file (.github/workflows/validate-test-opt-spec-workdir-file.yml) to GitHub and you're all set 🚀
🦉 If you have any more questions, feel free to drop us a line! [email protected]
"
`;
exports[`rdme openapi validate > GHA onboarding E2E tests > should create GHA workflow if user passes in spec via opt (including workingDirectory) 2`] = `
"# This GitHub Actions workflow was auto-generated by the \`rdme\` cli on 2022-01-01T00:00:00.000Z
# You can view our full documentation here: https://docs.readme.com/docs/rdme
name: ReadMe GitHub Action 🦉
on:
push:
branches:
# This workflow will run every time you push code to the following branch: \`validate-test-opt-spec-github-branch\`
# Check out GitHub's docs for more info on configuring this:
# https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
- validate-test-opt-spec-github-branch
jobs:
rdme-openapi-validate:
runs-on: ubuntu-latest
steps:
- name: Check out repo 📚
uses: actions/checkout@v4
- name: Run \`openapi validate\` command 🚀
uses: readmeio/rdme@v7
with:
rdme: openapi validate petstore.json --workingDirectory=./__tests__/__fixtures__/relative-ref-oas
"
`;
exports[`rdme openapi validate > GHA onboarding E2E tests > should create GHA workflow if user passes in spec via opt 1`] = `
"
Your GitHub Actions workflow file has been created! ✨
Almost done! Push your newly created file (.github/workflows/validate-test-opt-spec-file.yml) to GitHub and you're all set 🚀
🦉 If you have any more questions, feel free to drop us a line! [email protected]
"
`;
exports[`rdme openapi validate > GHA onboarding E2E tests > should create GHA workflow if user passes in spec via opt 2`] = `
"# This GitHub Actions workflow was auto-generated by the \`rdme\` cli on 2022-01-01T00:00:00.000Z
# You can view our full documentation here: https://docs.readme.com/docs/rdme
name: ReadMe GitHub Action 🦉
on:
push:
branches:
# This workflow will run every time you push code to the following branch: \`validate-test-opt-spec-branch\`
# Check out GitHub's docs for more info on configuring this:
# https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
- validate-test-opt-spec-branch
jobs:
rdme-openapi-validate:
runs-on: ubuntu-latest
steps:
- name: Check out repo 📚
uses: actions/checkout@v4
- name: Run \`openapi validate\` command 🚀
uses: readmeio/rdme@v7
with:
rdme: openapi validate __tests__/__fixtures__/petstore-simple-weird-version.json
"
`;
exports[`rdme openapi validate > GHA onboarding E2E tests > should create GHA workflow if user passes in spec via prompts 1`] = `
"
Your GitHub Actions workflow file has been created! ✨
Almost done! Push your newly created file (.github/workflows/validate-test-file.yml) to GitHub and you're all set 🚀
🦉 If you have any more questions, feel free to drop us a line! [email protected]
"
`;
exports[`rdme openapi validate > GHA onboarding E2E tests > should create GHA workflow if user passes in spec via prompts 2`] = `
"# This GitHub Actions workflow was auto-generated by the \`rdme\` cli on 2022-01-01T00:00:00.000Z
# You can view our full documentation here: https://docs.readme.com/docs/rdme
name: ReadMe GitHub Action 🦉
on:
push:
branches:
# This workflow will run every time you push code to the following branch: \`validate-test-branch\`
# Check out GitHub's docs for more info on configuring this:
# https://docs.github.com/actions/using-workflows/events-that-trigger-workflows
- validate-test-branch
jobs:
rdme-openapi-validate:
runs-on: ubuntu-latest
steps:
- name: Check out repo 📚
uses: actions/checkout@v4
- name: Run \`openapi validate\` command 🚀
uses: readmeio/rdme@v7
with:
rdme: openapi validate __tests__/__fixtures__/petstore-simple-weird-version.json
"
`;
exports[`rdme openapi validate > error handling > should throw an error if an invalid API definition has many errors 1`] = `
[ValidationError: OpenAPI schema validation failed.
REQUIRED must have required property 'url'
7 | },
8 | "servers": [
> 9 | {
| ^ url is missing here!
10 | "urll": "http://petstore.swagger.io/v2"
11 | }
12 | ],
ADDITIONAL PROPERTY must NOT have additional properties
24 | "/pet/findByStatus": {
25 | "get": {
> 26 | "tagss": [
| ^^^^^^^ tagss is not expected to be here!
27 | "pet"
28 | ],
29 | "summary": "Finds Pets by status",]
`;
exports[`rdme openapi validate > error handling > should throw an error if an invalid OpenAPI 3.0 definition is supplied 1`] = `
[ValidationError: API definition schema validation failed.
Missing $ref pointer "#/components/schemas/Error". Token "Error" does not exist.]
`;
exports[`rdme openapi validate > error handling > should throw an error if an invalid OpenAPI 3.1 definition is supplied 1`] = `
[ValidationError: OpenAPI schema validation failed.
REQUIRED must have required property 'name'
24 | "components": {
25 | "securitySchemes": {
> 26 | "tlsAuth": {
| ^ name is missing here!
27 | "type": "mutualTLS"
28 | }
29 | }]
`;
exports[`rdme openapi validate > error handling > should throw an error if an invalid Swagger definition is supplied 1`] = `
[ValidationError: Swagger schema validation failed.
ADDITIONAL PROPERTY must NOT have additional properties
23 | "description": "Find out more",
24 | "url": "http://swagger.io",
> 25 | "this-shouldnt-be-here": true
| ^^^^^^^^^^^^^^^^^^^^^^^ this-shouldnt-be-here is not expected to be here!
26 | }
27 | }
28 | ],]
`;