@aws-cdk_integ-tests-alpha.IntegTest

class IntegTest (construct) ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.IntegTests.Alpha.IntegTest
Gogithub.com/aws/aws-cdk-go/awscdkintegtestsalpha/v2#IntegTest
Javasoftware.amazon.awscdk.integtests.alpha.IntegTest
Pythonaws_cdk.integ_tests_alpha.IntegTest
TypeScript (source)@aws-cdk/integ-tests-alpha ยป IntegTest

Implements IConstruct, IDependable

A collection of test cases.

Each test case file should contain exactly one instance of this class.

Example

declare const myCustomResource: CustomResource;
declare const stack: Stack;
declare const app: App;

const integ = new IntegTest(app, 'Integ', { testCases: [stack] });
integ.assertions.expect(
  'CustomAssertion',
  ExpectedResult.objectLike({ foo: 'bar' }),
  ActualResult.fromCustomResource(myCustomResource, 'data'),
);

Initializer

new IntegTest(scope: Construct, id: string, props: IntegTestProps)

Parameters

  • scope Construct
  • id string
  • props IntegTestProps

Construct Props

NameTypeDescription
testCases๐Ÿ”นStack[]List of test cases that make up this test.
allowDestroy?๐Ÿ”นstring[]List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test.
assertionStack?๐Ÿ”นStackSpecify a stack to use for assertions.
cdkCommandOptions?๐Ÿ”นCdkCommandsAdditional options to use for each CDK command.
diffAssets?๐Ÿ”นbooleanWhether or not to include asset hashes in the diff Asset hashes can introduces a lot of unneccessary noise into tests, but there are some cases where asset hashes should be included.
enableLookups?๐Ÿ”นbooleanEnable lookups for this test.
hooks?๐Ÿ”นHooksAdditional commands to run at predefined points in the test workflow.
regions?๐Ÿ”นstring[]Limit deployment to these regions.
stackUpdateWorkflow?๐Ÿ”นbooleanRun update workflow on this test case This should only be set to false to test scenarios that are not possible to test as part of the update workflow.

testCases๐Ÿ”น

Type: Stack[]

List of test cases that make up this test.


allowDestroy?๐Ÿ”น

Type: string[] (optional, default: do not allow destruction of any resources on update)

List of CloudFormation resource types in this stack that can be destroyed as part of an update without failing the test.

This list should only include resources that for this specific integration test we are sure will not cause errors or an outage if destroyed. For example, maybe we know that a new resource will be created first before the old resource is destroyed which prevents any outage.

e.g. ['AWS::IAM::Role']


assertionStack?๐Ÿ”น

Type: Stack (optional, default: a stack is created for you)

Specify a stack to use for assertions.


cdkCommandOptions?๐Ÿ”น

Type: CdkCommands (optional, default: runner default options)

Additional options to use for each CDK command.


diffAssets?๐Ÿ”น

Type: boolean (optional, default: false)

Whether or not to include asset hashes in the diff Asset hashes can introduces a lot of unneccessary noise into tests, but there are some cases where asset hashes should be included.

For example any tests involving custom resources or bundling


enableLookups?๐Ÿ”น

Type: boolean (optional, default: false)

Enable lookups for this test.

If lookups are enabled then stackUpdateWorkflow must be set to false. Lookups should only be enabled when you are explicitly testing lookups.


hooks?๐Ÿ”น

Type: Hooks (optional, default: no hooks)

Additional commands to run at predefined points in the test workflow.

e.g. { postDeploy: ['yarn', 'test'] }


regions?๐Ÿ”น

Type: string[] (optional, default: can run in any region)

Limit deployment to these regions.


stackUpdateWorkflow?๐Ÿ”น

Type: boolean (optional, default: true)

Run update workflow on this test case This should only be set to false to test scenarios that are not possible to test as part of the update workflow.

Properties

NameTypeDescription
assertions๐Ÿ”นIDeployAssertMake assertions on resources in this test case.
node๐Ÿ”นNodeThe tree node.

assertions๐Ÿ”น

Type: IDeployAssert

Make assertions on resources in this test case.


node๐Ÿ”น

Type: Node

The tree node.

Methods

NameDescription
toString()๐Ÿ”นReturns a string representation of this construct.

toString()๐Ÿ”น

public toString(): string

Returns

  • string

Returns a string representation of this construct.