Skip to content

Rewrite createServicePolicy tests#8666

Open
mcmire wants to merge 1 commit intomainfrom
rewrite-create-service-policy-tests
Open

Rewrite createServicePolicy tests#8666
mcmire wants to merge 1 commit intomainfrom
rewrite-create-service-policy-tests

Conversation

@mcmire
Copy link
Copy Markdown
Contributor

@mcmire mcmire commented May 1, 2026

Explanation

The tests for createServicePolicy are too exhaustive and are very painful to maintain. This commit rewrites the tests so that they focus on covering all lines instead of all code paths.

Note that there are still some coverage issues with createServicePolicy because Istanbul treats the re-exported Cockatiel functions as untested. There doesn't seem to be a way around this short of switching to v8. We may consider doing that in another commit, but that is out of scope for now.

References

(Prerequisite for another PR that updates createServicePolicy)

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

The tests for `createServicePolicy` are too exhaustive and are very
painful to maintain. This commit rewrites the tests so that they focus
on covering all lines instead of all code paths.

Note that there are still some coverage issues with
`createServicePolicy` because Istanbul treats the re-exported Cockatiel
functions as untested. There doesn't seem to be a way around this short
of switching to v8.
@mcmire
Copy link
Copy Markdown
Contributor Author

mcmire commented May 1, 2026

Adding no-changelog because this PR only contains changes to tests.


expect(mockService).toHaveBeenCalledTimes(1);
});
describe('execute', () => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably best to view this file on its own rather than going through the diff.

@mcmire mcmire marked this pull request as ready for review May 1, 2026 17:38
@mcmire mcmire requested a review from a team as a code owner May 1, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant