Skip to content

(assertions): assertion inversion #15868

@nija-at

Description

@nija-at

Provide the ability to invert the list of assertions - hasResource(), hasResourceProperties(), etc. - to be inverted or negated, i.e., "does not have resource", "does not have resource with properties", etc.

See #15857 (comment)


Alternatively, the current experience of the following against a template that has no "Foo::Bar" resource will fail with the error "No resource matching Foo::Bar".

hasResourceProperties('Foo::Bar', Match.not({
  Baz: 'Qux'
}));

This needs to be fixed.


This is a 🚀 Feature Request

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/assertionsRelated to the @aws-cdk/assertv2 packageeffort/mediumMedium work item – several days of effortfeature-requestA feature should be added or improved.p2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions