Skip to content

Commit

Permalink
Updated overlay metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
thim81 committed Jan 1, 2025
1 parent 22e641b commit d329484
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## unreleased

## [1.25.0] - 2025-01-02
## [1.25.0] - 2025-01-01

- CLI - Added option to apply OpenAPI overlay actions

Expand Down
10 changes: 5 additions & 5 deletions test/overlay.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('openapi-format CLI overlay tests', () => {

const result = await openapiOverlay(baseOAS, { overlaySet });
expect(result.data).toHaveProperty('externalDocs', { url: 'https://docs.example.com' });
expect(result.resultData.appliedActions).toBe(1);
expect(result.resultData.totalUsedActions).toBe(1);
expect(result.resultData.unusedActions.length).toBe(0);
});

Expand Down Expand Up @@ -132,7 +132,7 @@ describe('openapi-format CLI overlay tests', () => {
const result = await openapiOverlay(baseOAS, { overlaySet });
expect(result.data).toHaveProperty('externalDocs', { url: 'https://docs.example.com' });
expect(result.resultData.totalActions).toBe(1);
expect(result.resultData.appliedActions).toBe(1);
expect(result.resultData.totalUsedActions).toBe(1);
expect(result.resultData.unusedActions.length).toBe(0);
});

Expand All @@ -149,7 +149,7 @@ describe('openapi-format CLI overlay tests', () => {
const result = await openapiOverlay(baseOAS, { overlaySet });
expect(result.data).toEqual({});
expect(result.resultData.totalActions).toBe(3);
expect(result.resultData.appliedActions).toBe(2);
expect(result.resultData.totalUsedActions).toBe(2);
expect(result.resultData.unusedActions.length).toBe(1);
});

Expand Down Expand Up @@ -178,7 +178,7 @@ describe('openapi-format CLI overlay tests', () => {
const result = await openapiOverlay(baseOAS, { overlaySet });
expect(result.resultData.unusedActions).toEqual(overlaySet.actions);
expect(result.resultData.totalActions).toBe(1);
expect(result.resultData.appliedActions).toBe(0);
expect(result.resultData.totalUsedActions).toBe(0);
});

it('should track unused, total, and applied actions correctly', async () => {
Expand All @@ -192,7 +192,7 @@ describe('openapi-format CLI overlay tests', () => {

const result = await openapiOverlay(baseOAS, { overlaySet });
expect(result.resultData.totalActions).toBe(2);
expect(result.resultData.appliedActions).toBe(1);
expect(result.resultData.totalUsedActions).toBe(1);
expect(result.resultData.unusedActions.length).toBe(1);
expect(result.resultData.unusedActions[0]).toEqual(overlaySet.actions[1]);
});
Expand Down

0 comments on commit d329484

Please sign in to comment.