Skip to content

Commit 132ab87

Browse files
authored
chore(dynamodb-global): migrate to Assertions (#18515)
---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 6a869f5 commit 132ab87

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/@aws-cdk/aws-dynamodb-global/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"constructs": "^3.3.69"
5757
},
5858
"devDependencies": {
59-
"@aws-cdk/assert-internal": "0.0.0",
59+
"@aws-cdk/assertions": "0.0.0",
6060
"@aws-cdk/cdk-build-tools": "0.0.0",
6161
"@aws-cdk/cdk-integ-tools": "0.0.0",
6262
"@aws-cdk/pkglint": "0.0.0",

packages/@aws-cdk/aws-dynamodb-global/test/dynamodb-global.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import '@aws-cdk/assert-internal/jest';
1+
import { Template } from '@aws-cdk/assertions';
22
import { Attribute, AttributeType, StreamViewType, Table } from '@aws-cdk/aws-dynamodb';
33
import { describeDeprecated, testDeprecated } from '@aws-cdk/cdk-build-tools';
44
import { App, CfnOutput, Stack } from '@aws-cdk/core';
@@ -26,7 +26,7 @@ describeDeprecated('Default Global DynamoDB stack', () => {
2626
const topStack = stack.node.findChild(CONSTRUCT_NAME) as Stack;
2727
for ( const reg of STACK_PROPS.regions ) {
2828
const tableStack = topStack.node.findChild(CONSTRUCT_NAME + '-' + reg) as Stack;
29-
expect(tableStack).toHaveResource('AWS::DynamoDB::Table', {
29+
Template.fromStack(tableStack).hasResourceProperties('AWS::DynamoDB::Table', {
3030
'KeySchema': [
3131
{
3232
'AttributeName': 'hashKey',
@@ -46,12 +46,12 @@ describeDeprecated('Default Global DynamoDB stack', () => {
4646
});
4747
}
4848
const customResourceStack = stack.node.findChild(CONSTRUCT_NAME + '-CustomResource') as Stack;
49-
expect(customResourceStack).toHaveResource('AWS::Lambda::Function', {
49+
Template.fromStack(customResourceStack).hasResourceProperties('AWS::Lambda::Function', {
5050
Description: 'Lambda to make DynamoDB a global table',
5151
Handler: 'index.handler',
5252
Timeout: 300,
5353
});
54-
expect(customResourceStack).toHaveResource('AWS::CloudFormation::CustomResource', {
54+
Template.fromStack(customResourceStack).hasResourceProperties('AWS::CloudFormation::CustomResource', {
5555
Regions: STACK_PROPS.regions,
5656
ResourceType: 'Custom::DynamoGlobalTableCoordinator',
5757
TableName: TABLE_NAME,
@@ -75,7 +75,7 @@ testDeprecated('GlobalTable generated stacks inherit their account from the pare
7575
value: globalTable.regionalTables[0].tableStreamArn!,
7676
});
7777

78-
expect(stack).toMatchTemplate({
78+
Template.fromStack(stack).templateMatches({
7979
'Outputs': {
8080
'DynamoDbOutput': {
8181
'Value': {

0 commit comments

Comments
 (0)