You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add chai plugin for the tool and add properties and methods.
Examples:
// stack.test.tsimport*ascdkfrom'aws-cdk-lib';import*asMyStackfrom'../lib/mystack.ts';import{chaiPlugin}from'aws-cdk-assert';import{use}from'chai';use(chaiPlugin);describe('MyStack',()=>{letstack: MyStack.Mystack;beforeAll(()=>{constapp=newcdk.App();stack=newMyStack.MyStack(app,'MyStack',{// props});});test('should have S3 Bucket',()=>{expect(stack).to.have.s3Bucket({bucketName: 'MyBucket'});});});
Options:
Single method per resource type with properties object for simple properties: expect(stack).to.have.s3Bucket({ bucketName: 'MyBucket' });
Resource properties and methods per each simple property (same as the resource methods): expect(stack).with.s3Bucket.withBucketName('MyBucket').exists;
The text was updated successfully, but these errors were encountered:
Add chai plugin for the tool and add properties and methods.
Examples:
Options:
expect(stack).to.have.s3Bucket({ bucketName: 'MyBucket' });
expect(stack).with.s3Bucket.withBucketName('MyBucket').exists;
The text was updated successfully, but these errors were encountered: