@aws-cdk/assert#countResourcesLike TypeScript Examples

The following examples show how to use @aws-cdk/assert#countResourcesLike. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: city-stack.test.ts    From MDDL with MIT License 6 votes vote down vote up
test('Default Stack', () => {
  const app = new cdk.App()
  // WHEN
  const dataStoreStack = new DataStoreStack(app, 'MyTestDataStoreStack', {})
  const stack = new CityStack(app, 'MyTestStack', {
    dataStoreStack,
    jwtAuth: {
      audience: ['https://my-audience.com'],
      issuer: 'https://my-audience.com',
      userInfoEndpoint: 'https://my-auth-endpoint/oauth/userinfo',
    },
    emailSender: {
      address: 'myemail',
      name: 'Me',
    },
  })
  // THEN
  expectCDK(stack).to(haveResource('AWS::IAM::Role'))
  expectCDK(stack).to(
    countResourcesLike('AWS::Lambda::Function', 28, {
      Handler: 'index.handler',
      Runtime: 'nodejs12.x',
      MemorySize: 512,
      Timeout: 60,
    }),
  )
})