Skip to content

Commit cf1464e

Browse files
committed
test: add operation.deprecatedInfo & operation.deprecatedInPreviousVersions checks
1 parent 27e473a commit cf1464e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

test/deprecated.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ describe('Deprecated Items test', () => {
7777
const deprecatedItems = Array.from(result.operations.values()).flatMap(operation => operation.deprecatedItems)
7878

7979
expect(deprecatedItems.every(item => item?.description?.startsWith('[Deprecated]'))).toBeTruthy()
80-
expect(result.operations.get('auth-saml-post')?.deprecatedItems?.[0].deprecatedInPreviousVersions.length).toBe(2)
80+
expect(result.operations.get('auth-saml-post')?.deprecatedItems?.[0].deprecatedInPreviousVersions).toEqual(['v1', 'v2'])
8181
expect(Array.from(result.operations.values())).toEqual(expect.toIncludeSameMembers([
82-
expect.objectContaining({ deprecated: true }),
82+
expect.objectContaining({ deprecated: true, deprecatedInfo: 'deprecated reason', deprecatedInPreviousVersions: ['v1', 'v2'] }),
8383
expect.objectContaining({ deprecated: false }),
8484
expect.objectContaining({ deprecated: false }),
8585
]))

test/projects/deprecated/PublicRegistry API(4)v2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ paths:
6565
- Auth
6666
summary: SAML authentication
6767
deprecated: true
68+
x-deprecated-meta: 'deprecated reason'
6869
description: |
6970
Starts the SAML authentication process in APIHUB.
7071

0 commit comments

Comments
 (0)