-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix(assertions): hasResourceProperties
is incompatible with Match.not
and Match.absent
#16678
Conversation
924c117
to
ebfd5f2
Compare
hasResourceProperties
is incompatible with Match.not
and Match.absentProperty
hasResourceProperties
is incompatible with Match.not
and Match.absent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR descriptions get converted into commit messages, so it will be a good idea to update this from what you have now.
Commit messages should usually contain what is being changed and why.
One minor comment below. Approved with 'do-not-merge' label.
@Mergifyio refresh |
Command
|
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
…not` and `Match.absent` (#16678) Fixes #16626. This PR modifies `hasResourceProperties()` so that it accounts for the special case where `Properties` does not exist on the template. The following assertions previously behaved incorrectly when `Properties` were not in the template and are now fixed: ```ts template.fromStack(stack); // some template with no `Properties`. // assert that `Properties` does not exist in the template. Returns true. template.hasResourceProperties('Foo::Bar', Match.absent()); // assert that `baz` is not a `Property` of 'Foo::Bar'. Returns true. template.hasResourceProperties('Foo::Bar', { baz: Match.absent(), }; // assert that `baz` does not have a value of `qux` in the `Properties` object. Returns true. template.hasResourceProperties('Foo::Bar', Match.not({baz: 'qux'}); ``` It also moves `AbsentMatch` into the `private` folder so that it can be exposed internally as a special case for `hasResourceProperties()`. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…not` and `Match.absent` (aws#16678) Fixes aws#16626. This PR modifies `hasResourceProperties()` so that it accounts for the special case where `Properties` does not exist on the template. The following assertions previously behaved incorrectly when `Properties` were not in the template and are now fixed: ```ts template.fromStack(stack); // some template with no `Properties`. // assert that `Properties` does not exist in the template. Returns true. template.hasResourceProperties('Foo::Bar', Match.absent()); // assert that `baz` is not a `Property` of 'Foo::Bar'. Returns true. template.hasResourceProperties('Foo::Bar', { baz: Match.absent(), }; // assert that `baz` does not have a value of `qux` in the `Properties` object. Returns true. template.hasResourceProperties('Foo::Bar', Match.not({baz: 'qux'}); ``` It also moves `AbsentMatch` into the `private` folder so that it can be exposed internally as a special case for `hasResourceProperties()`. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Fixes #16626.
This PR modifies
hasResourceProperties()
so that it accounts for the special case whereProperties
does not exist on the template. The following assertions previously behaved incorrectly whenProperties
were not in the template and are now fixed:It also moves
AbsentMatch
into theprivate
folder so that it can be exposed internally as a special case forhasResourceProperties()
.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license