Skip to content

Commit e086d57

Browse files
committed
Add test
1 parent 64dd03b commit e086d57

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/execute.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,23 @@ describe('execute', () => {
271271
expect(() => buildRequest({spec, operationId: 'getMe'})).toThrow('Required parameter petId is not provided')
272272
})
273273

274+
it('should throw error if operation was not found', function () {
275+
// Given
276+
const spec = {
277+
host: 'swagger.io',
278+
basePath: '/v1',
279+
paths: {
280+
'/one': {
281+
get: {
282+
operationId: 'getMe'
283+
}
284+
}
285+
}
286+
}
287+
288+
expect(() => buildRequest({spec, operationId: 'nonExistingOperationId'})).toThrow('Operation nonExistingOperationId not found')
289+
})
290+
274291
describe('formData', function () {
275292
it('should add an empty query param if the value is empty and allowEmptyValue: true', function () {
276293
// Given

0 commit comments

Comments
 (0)