aws / aws/aws-cdk

(assertions): Match.greaterThan() and Match.lessThan()

Open
#18,818 2 comments 2 reactions 0 assignees View on GitHub
@aws-cdk/core effort/small feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Description

Looking for a suite of Matchers on numbers specifically.

### Use Case

It would be great to be able to do something like this:

```ts
const template = Template.fromStack(stack).resourceCountIs('Foo::Bar', Match.greaterThan(0));
```

### Proposed Solution

Something like: `Match.greaterThan(number: number)` and `Match.lessThan(number: number)`.
For now, the use case is only really for `Template.fromStack().resourceCountIs()`, I think.

### Other information

_No response_

### Acknowledge

- [X] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

Contributor guide

Open the contributing guide

Research direction

Start by tracing the assertions Match API and Template.fromStack().resourceCountIs(), since the issue identifies those entry points. Check how existing matchers are tested, then add numeric greater-than and less-than matcher coverage and confirm the resourceCountIs() use case works as proposed.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.