-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(assert): Adjust assertion behavior to be stricter (#1289)
The SUPERSET matching mode would have aborted successfully upon finding
the first acceptable change (a change that is a CREATE), and not look at
subsequent changes, hence allowing any other type of update to pass as
long as it is detected later in the template. This change fixes that such that the
assertion will reject upon any change that is NOT a CREATE change.
Additionally, the default behavior of the `haveResource` matcher was changed
to not allow additional values in objects below the root of the expectation, which
makes it harder to write tests that inadvertently allow excessive IAM policies or
network security settings (amounts other things) to pass when the user intention
was for them to fail.
BREAKING CHANGE: the behavior change of `haveResource` can cause tests to
fail. If allowing extension of the expected values is the intended behavior, you can
switch to the `haveResourceLike` matcher instead, which exposes the previous
behavior.
Fixes awslabs/cdk-ops#186
- Loading branch information
1 parent
3d40e13
commit 0919bf4
Showing
34 changed files
with
341 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.