Skip to main content
Testing utilities for cdktf applications.

Initializers

import { Testing } from 'cdktn'

new Testing()
NameTypeDescription

Static Functions

NameDescription
appReturns an app for testing with the following properties: - Output directory is a temp dir.
enableFutureFlagsNo description.
fakeCdktfJsonPathNo description.
fullSynthNo description.
renderConstructTreeNo description.
setupJestNo description.
stubVersionNo description.
synthReturns the Terraform synthesized JSON.
synthHclReturns the Terraform synthesized JSON.
synthScopeNo description.
toBeValidTerraformNo description.
toHaveDataSourceNo description.
toHaveDataSourceWithPropertiesNo description.
toHaveProviderNo description.
toHaveProviderWithPropertiesNo description.
toHaveResourceNo description.
toHaveResourceWithPropertiesNo description.

app

import { Testing } from 'cdktn'

Testing.app(options?: TestingAppConfig)
Returns an app for testing with the following properties: - Output directory is a temp dir.

optionsOptional


enableFutureFlags

import { Testing } from 'cdktn'

Testing.enableFutureFlags(app: App)

appRequired


fakeCdktfJsonPath

import { Testing } from 'cdktn'

Testing.fakeCdktfJsonPath(app: App)

appRequired


fullSynth

import { Testing } from 'cdktn'

Testing.fullSynth(stack: TerraformStack)

stackRequired


renderConstructTree

import { Testing } from 'cdktn'

Testing.renderConstructTree(construct: IConstruct)

constructRequired

  • Type: constructs.IConstruct

setupJest

import { Testing } from 'cdktn'

Testing.setupJest()

stubVersion

import { Testing } from 'cdktn'

Testing.stubVersion(app: App)

appRequired


synth

import { Testing } from 'cdktn'

Testing.synth(stack: TerraformStack, runValidations?: boolean)
Returns the Terraform synthesized JSON.

stackRequired


runValidationsOptional

  • Type: boolean

synthHcl

import { Testing } from 'cdktn'

Testing.synthHcl(stack: TerraformStack, runValidations?: boolean, returnMetadata?: boolean)
Returns the Terraform synthesized JSON.

stackRequired


runValidationsOptional

  • Type: boolean

returnMetadataOptional

  • Type: boolean

synthScope

import { Testing } from 'cdktn'

Testing.synthScope(fn: IScopeCallback)

fnRequired


toBeValidTerraform

import { Testing } from 'cdktn'

Testing.toBeValidTerraform(received: string)

receivedRequired

  • Type: string

toHaveDataSource

import { Testing } from 'cdktn'

Testing.toHaveDataSource(received: string, resourceType: string)

receivedRequired

  • Type: string

resourceTypeRequired

  • Type: string

toHaveDataSourceWithProperties

import { Testing } from 'cdktn'

Testing.toHaveDataSourceWithProperties(received: string, resourceType: string, properties?: {[ key: string ]: any})

receivedRequired

  • Type: string

resourceTypeRequired

  • Type: string

propertiesOptional

  • Type: {[ key: string ]: any}

toHaveProvider

import { Testing } from 'cdktn'

Testing.toHaveProvider(received: string, resourceType: string)

receivedRequired

  • Type: string

resourceTypeRequired

  • Type: string

toHaveProviderWithProperties

import { Testing } from 'cdktn'

Testing.toHaveProviderWithProperties(received: string, resourceType: string, properties?: {[ key: string ]: any})

receivedRequired

  • Type: string

resourceTypeRequired

  • Type: string

propertiesOptional

  • Type: {[ key: string ]: any}

toHaveResource

import { Testing } from 'cdktn'

Testing.toHaveResource(received: string, resourceType: string)

receivedRequired

  • Type: string

resourceTypeRequired

  • Type: string

toHaveResourceWithProperties

import { Testing } from 'cdktn'

Testing.toHaveResourceWithProperties(received: string, resourceType: string, properties?: {[ key: string ]: any})

receivedRequired

  • Type: string

resourceTypeRequired

  • Type: string

propertiesOptional

  • Type: {[ key: string ]: any}