Skip to content

Commit

Permalink
Merge branch 'master' into rmuller/rewrite-imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jun 9, 2020
2 parents 7a829ab + f656ea7 commit db18753
Show file tree
Hide file tree
Showing 187 changed files with 5,199 additions and 1,513 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ for tracking bugs and feature requests.
* Ask a question on [Stack Overflow](https://stackoverflow.com/questions/tagged/aws-cdk)
and tag it with `aws-cdk`
* Come join the AWS CDK community on [Gitter](https://gitter.im/awslabs/aws-cdk)
* Talk in the CDK channel of the [AWS Developers Slack workspace](https://awsdevelopers.slack.com) (invite required)
* Open a support ticket with [AWS Support](https://console.aws.amazon.com/support/home#/)
* If it turns out that you may have found a bug,
please open an [issue](https://github.com/aws/aws-cdk/issues/new)
Expand Down
8 changes: 8 additions & 0 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# Actually adding any artifact type will break the load() type signature because I could have written
# const x: A | B = Manifest.load();
# and that won't typecheck if Manifest.load() adds a union arm and now returns A | B | C.
change-return-type:@aws-cdk/cloud-assembly-schema.Manifest.load

removed:@aws-cdk/core.BootstraplessSynthesizer.DEFAULT_ASSET_PUBLISHING_ROLE_ARN
removed:@aws-cdk/core.DefaultStackSynthesizer.DEFAULT_ASSET_PUBLISHING_ROLE_ARN
removed:@aws-cdk/core.DefaultStackSynthesizerProps.assetPublishingExternalId
removed:@aws-cdk/core.DefaultStackSynthesizerProps.assetPublishingRoleArn
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ echo "==========================================================================
echo "building..."
time lerna run $bail --stream $runtarget || fail

DOWNLOAD_LATEST=true /bin/bash scripts/check-api-compatibility.sh
/bin/bash scripts/check-api-compatibility.sh

touch $BUILD_INDICATOR
31 changes: 30 additions & 1 deletion packages/@aws-cdk/assert/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ If you only care that a resource of a particular type exists (regardless of its

```ts
haveResource(type, subsetOfProperties)
haveResourceLike(type, subsetOfProperties)
```

Example:
Expand All @@ -76,7 +77,35 @@ expect(stack).to(haveResource('AWS::CertificateManager::Certificate', {
}));
```

`ABSENT` is a magic value to assert that a particular key in an object is *not* set (or set to `undefined`).
The object you give to `haveResource`/`haveResourceLike` like can contain the
following values:

- **Literal values**: the given property in the resource must match the given value *exactly*.
- `ABSENT`: a magic value to assert that a particular key in an object is *not* set (or set to `undefined`).
- `arrayWith(...)`/`objectLike(...)`/`deepObjectLike(...)`/`exactValue()`: special matchers
for inexact matching. You can use these to match arrays where not all elements have to match,
just a single one, or objects where not all keys have to match.

The difference between `haveResource` and `haveResourceLike` is the same as
between `objectLike` and `deepObjectLike`: the first allows
additional (unspecified) object keys only at the *first* level, while the
second one allows them in nested objects as well.

If you want to escape from the "deep lenient matching" behavior, you can use
`exactValue()`.

Slightly more complex example with array matchers:

```ts
expect(stack).to(haveResourceLike('AWS::IAM::Policy', {
PolicyDocument: {
Statement: arrayWith(objectLike({
Action: ['s3:GetObject'],
Resource: ['arn:my:arn'],
}})
}
}));
```
### Check number of resources
Expand Down
Loading

0 comments on commit db18753

Please sign in to comment.