Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Test Utils as part of the library #1616

Open
2 tasks
FlorianWeissDev opened this issue Mar 4, 2024 · 3 comments
Open
2 tasks

feat: Test Utils as part of the library #1616

FlorianWeissDev opened this issue Mar 4, 2024 · 3 comments
Labels
feature-request A feature should be added or improved.

Comments

@FlorianWeissDev
Copy link

Description

I'm writing my own pack with a mix of custom rules and AWS rules. Now, I want to test these rules, and I've noticed that you've already written some utilities to make testing a little bit easier and better structured. Have you considered bundling these utilities with the library itself?

Use Case

Authors of custom cdk-nag-packs most likely want or need to test their rules.

Proposed Solution

Add existing utilities to the library.

Other information

No response

Acknowledge

  • I may be able to implement this feature request
  • This feature might incur a breaking change
@FlorianWeissDev FlorianWeissDev added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Mar 4, 2024
@dontirun
Copy link
Collaborator

I have not because the utils use old libraries and occasionally get refactored for new features. I don't want to break users when this happens

@dontirun dontirun removed the needs-triage This issue or PR still needs to be triaged. label Mar 10, 2024
@JohannesKonings
Copy link
Contributor

That would be also helpful for me. Could the util exported with a expermimental post fix or something else?
Otherwise I have to copy them from the library and watch for changes 😄

@FlorianWeissDev
Copy link
Author

FlorianWeissDev commented May 21, 2024

That would be also helpful for me. Could the util exported with a expermimental post fix or something else? Otherwise I have to copy them from the library and watch for changes 😄

@JohannesKonings, I decided to use the Annotation Matching to test my rules. Maybe this is helpful for you as well.

Annotations.fromStack(stack).hasNoWarning('*', Match.stringLikeRegexp('.*MyRule.*'));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants