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

chore(assertions): replace absentProperty() with absent() and support it as a Matcher type #16653

Merged
merged 15 commits into from
Oct 5, 2021
Merged

chore(assertions): replace absentProperty() with absent() and support it as a Matcher type #16653

merged 15 commits into from
Oct 5, 2021

Conversation

kaizencc
Copy link
Contributor

@kaizencc kaizencc commented Sep 24, 2021

Currently Match.absentProperty() is not of type Matcher and this introduces a few flaws. For example, Matcher.isMatcher(Match.absentProperty()) is false.

This PR fixes this issue by replacing Match.absentProperty() with Match.absent() that is of type Matcher. The decision to change the name is due to supporting this as a general matcher and not just for Properties.

BREAKING CHANGE: Match.absentProperty() becomes Match.absent(), and its type changes from string to Matcher.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@gitpod-io
Copy link

gitpod-io bot commented Sep 24, 2021

@nija-at
Copy link
Contributor

nija-at commented Sep 27, 2021

the following does not work as intended

template.hasResourceProperties('Foo::Bar', Match.absentProperty()); 

I don't understand the problem. What is the expected behaviour here?
The line above just as stated is confusing.

I believe you are trying to solve the issue #16626. I'll continue the conversation regarding this directly on the issue (since it's easier to follow the conversation).

@kaizencc kaizencc changed the title fix(assertions): absentProperty is not of type Matcher feat(assertions): replace absentProperty() with absent() and support it as a Matcher type Sep 27, 2021
packages/@aws-cdk/assertions/lib/match.ts Outdated Show resolved Hide resolved
@mergify
Copy link
Contributor

mergify bot commented Sep 28, 2021

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).

@nija-at nija-at changed the title feat(assertions): replace absentProperty() with absent() and support it as a Matcher type chore(assertions): replace absentProperty() with absent() and support it as a Matcher type Sep 28, 2021
@mergify
Copy link
Contributor

mergify bot commented Sep 28, 2021

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).

@kaizencc
Copy link
Contributor Author

kaizencc commented Oct 5, 2021

@Mergifyio refresh

@mergify
Copy link
Contributor

mergify bot commented Oct 5, 2021

Command refresh: success

Pull request refreshed

@peterwoodworth peterwoodworth changed the title chore(assertions): replace absentProperty() with absent() and support it as a Matcher type chore(assertions): replace absentProperty() with absent() and support it as Matcher type Oct 5, 2021
@peterwoodworth peterwoodworth changed the title chore(assertions): replace absentProperty() with absent() and support it as Matcher type chore(assertions): replace absentProperty() with absent() and support it as a Matcher type Oct 5, 2021
@mergify
Copy link
Contributor

mergify bot commented Oct 5, 2021

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).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject89A8053A-LhjRyN9kxr8o
  • Commit ID: f8dc97c
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify mergify bot merged commit c980185 into aws:master Oct 5, 2021
@mergify
Copy link
Contributor

mergify bot commented Oct 5, 2021

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).

njlynch pushed a commit that referenced this pull request Oct 11, 2021
…port it as a `Matcher` type (#16653)

Currently `Match.absentProperty()` is not of type `Matcher` and this introduces a few flaws. For example, `Matcher.isMatcher(Match.absentProperty())` is `false`.

This PR fixes this issue by replacing `Match.absentProperty()` with `Match.absent()` that is of type `Matcher`. The decision to change the name is due to supporting this as a general matcher and not just for Properties.

BREAKING CHANGE: `Match.absentProperty()` becomes `Match.absent()`, and its type changes from `string` to `Matcher`.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@kaizencc kaizencc deleted the assertions/bug branch October 13, 2021 16:39
TikiTDO pushed a commit to TikiTDO/aws-cdk that referenced this pull request Feb 21, 2022
…port it as a `Matcher` type (aws#16653)

Currently `Match.absentProperty()` is not of type `Matcher` and this introduces a few flaws. For example, `Matcher.isMatcher(Match.absentProperty())` is `false`.

This PR fixes this issue by replacing `Match.absentProperty()` with `Match.absent()` that is of type `Matcher`. The decision to change the name is due to supporting this as a general matcher and not just for Properties.

BREAKING CHANGE: `Match.absentProperty()` becomes `Match.absent()`, and its type changes from `string` to `Matcher`.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants