Skip to content

Commit 3097c0d

Browse files
authored
chore(codecommit): migrate tests to use the Assertions module (#18548)
---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent cf09454 commit 3097c0d

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/@aws-cdk/aws-codecommit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
},
8585
"license": "Apache-2.0",
8686
"devDependencies": {
87-
"@aws-cdk/assert-internal": "0.0.0",
87+
"@aws-cdk/assertions": "0.0.0",
8888
"@aws-cdk/aws-sns": "0.0.0",
8989
"@aws-cdk/cdk-build-tools": "0.0.0",
9090
"@aws-cdk/cdk-integ-tools": "0.0.0",

packages/@aws-cdk/aws-codecommit/test/codecommit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import '@aws-cdk/assert-internal/jest';
21
import { join, resolve } from 'path';
2+
import { Template } from '@aws-cdk/assertions';
33
import { Role, ServicePrincipal } from '@aws-cdk/aws-iam';
44
import { Asset } from '@aws-cdk/aws-s3-assets';
55
import * as cxschema from '@aws-cdk/cloud-assembly-schema';
@@ -19,7 +19,7 @@ describe('codecommit', () => {
1919

2020
new Repository(stack, 'MyRepository', props).notify(snsArn);
2121

22-
expect(stack).toMatchTemplate({
22+
Template.fromStack(stack).templateMatches({
2323
Resources: {
2424
MyRepository4C4BD5FC: {
2525
Type: 'AWS::CodeCommit::Repository',
@@ -258,7 +258,7 @@ describe('codecommit', () => {
258258
repository.grantPullPush(role);
259259

260260
// THEN
261-
expect(stack).toHaveResource('AWS::IAM::Policy', {
261+
Template.fromStack(stack).hasResourceProperties('AWS::IAM::Policy', {
262262
PolicyDocument: {
263263
Statement: [
264264
{

packages/@aws-cdk/aws-codecommit/test/notification-rule.test.ts

Lines changed: 3 additions & 3 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 * as sns from '@aws-cdk/aws-sns';
33
import * as cdk from '@aws-cdk/core';
44
import * as codecommit from '../lib';
@@ -16,7 +16,7 @@ describe('notification rule', () => {
1616

1717
repository.notifyOnPullRequestMerged('NotifyOnPullRequestMerged', target);
1818

19-
expect(stack).toHaveResource('AWS::CodeStarNotifications::NotificationRule', {
19+
Template.fromStack(stack).hasResourceProperties('AWS::CodeStarNotifications::NotificationRule', {
2020
Name: 'MyCodecommitRepositoryNotifyOnPullRequestCreatedBB14EA32',
2121
DetailType: 'FULL',
2222
EventTypeIds: [
@@ -38,7 +38,7 @@ describe('notification rule', () => {
3838
],
3939
});
4040

41-
expect(stack).toHaveResource('AWS::CodeStarNotifications::NotificationRule', {
41+
Template.fromStack(stack).hasResourceProperties('AWS::CodeStarNotifications::NotificationRule', {
4242
Name: 'MyCodecommitRepositoryNotifyOnPullRequestMerged34A7EDF1',
4343
DetailType: 'FULL',
4444
EventTypeIds: [

0 commit comments

Comments
 (0)