Skip to content

Commit

Permalink
chore(client): reformat specifications structure in tests
Browse files Browse the repository at this point in the history
Improved the readability and maintainability of the `getOperationById` test suite by adjusting the formatting of the specifications object. This change enhances clarity in the structure, making it easier to follow and modify the tests as needed. This commit does not alter the functionality but improves the code quality in test files.
  • Loading branch information
shorwood committed Nov 22, 2024
1 parent d5849e3 commit 92d1df6
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/client/openapi/getOperationById.test.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
import { getOperationById } from './getOperationById'

describe('getOperationById', () => {
const specifications = { paths: {
'/users': {
get: { operationId: 'getUsers' },
post: { operationId: 'createUser' },
const specifications = {
paths: {
'/users': {
get: { operationId: 'getUsers' },
post: { operationId: 'createUser' },
},
'/users/{username}': {
get: { operationId: 'getUser' },
delete: { operationId: 'deleteUser' },
},
},
'/users/{username}': {
get: { operationId: 'getUser' },
delete: { operationId: 'deleteUser' },
},
} } as const
} as const

it('should return the correct operation for a valid operationId', () => {
const result = getOperationById(specifications, 'deleteUser')
Expand Down

0 comments on commit 92d1df6

Please sign in to comment.