Skip to main content

Documentation Index

Fetch the complete documentation index at: https://cdktn.io/docs/llms.txt

Use this file to discover all available pages before exploring further.

Testing utilities for cdktf applications.

Initializers

import cdktn

cdktn.Testing()
NameTypeDescription

Static Functions

NameDescription
appReturns an app for testing with the following properties: - Output directory is a temp dir.
enable_future_flagsNo description.
fake_cdktf_json_pathNo description.
full_synthNo description.
render_construct_treeNo description.
setup_jestNo description.
stub_versionNo description.
synthReturns the Terraform synthesized JSON.
synth_hclReturns the Terraform synthesized JSON.
synth_scopeNo description.
to_be_valid_terraformNo description.
to_have_data_sourceNo description.
to_have_data_source_with_propertiesNo description.
to_have_providerNo description.
to_have_provider_with_propertiesNo description.
to_have_resourceNo description.
to_have_resource_with_propertiesNo description.

app

import cdktn

cdktn.Testing.app(
  context: typing.Mapping[typing.Any] = None,
  enable_future_flags: bool = None,
  fake_cdktf_json_path: bool = None,
  outdir: str = None,
  stack_traces: bool = None,
  stub_version: bool = None
)
Returns an app for testing with the following properties: - Output directory is a temp dir.

contextOptional

  • Type: typing.Mapping[typing.Any]

enable_future_flagsOptional

  • Type: bool

fake_cdktf_json_pathOptional

  • Type: bool

outdirOptional

  • Type: str

stack_tracesOptional

  • Type: bool

stub_versionOptional

  • Type: bool

enable_future_flags

import cdktn

cdktn.Testing.enable_future_flags(
  app: App
)

appRequired


fake_cdktf_json_path

import cdktn

cdktn.Testing.fake_cdktf_json_path(
  app: App
)

appRequired


full_synth

import cdktn

cdktn.Testing.full_synth(
  stack: TerraformStack
)

stackRequired


render_construct_tree

import cdktn

cdktn.Testing.render_construct_tree(
  construct: IConstruct
)

constructRequired

  • Type: constructs.IConstruct

setup_jest

import cdktn

cdktn.Testing.setup_jest()

stub_version

import cdktn

cdktn.Testing.stub_version(
  app: App
)

appRequired


synth

import cdktn

cdktn.Testing.synth(
  stack: TerraformStack,
  run_validations: bool = None
)
Returns the Terraform synthesized JSON.

stackRequired


run_validationsOptional

  • Type: bool

synth_hcl

import cdktn

cdktn.Testing.synth_hcl(
  stack: TerraformStack,
  run_validations: bool = None,
  return_metadata: bool = None
)
Returns the Terraform synthesized JSON.

stackRequired


run_validationsOptional

  • Type: bool

return_metadataOptional

  • Type: bool

synth_scope

import cdktn

cdktn.Testing.synth_scope(
  fn: IScopeCallback
)

fnRequired


to_be_valid_terraform

import cdktn

cdktn.Testing.to_be_valid_terraform(
  received: str
)

receivedRequired

  • Type: str

to_have_data_source

import cdktn

cdktn.Testing.to_have_data_source(
  received: str,
  resource_type: str
)

receivedRequired

  • Type: str

resource_typeRequired

  • Type: str

to_have_data_source_with_properties

import cdktn

cdktn.Testing.to_have_data_source_with_properties(
  received: str,
  resource_type: str,
  properties: typing.Mapping[typing.Any] = None
)

receivedRequired

  • Type: str

resource_typeRequired

  • Type: str

propertiesOptional

  • Type: typing.Mapping[typing.Any]

to_have_provider

import cdktn

cdktn.Testing.to_have_provider(
  received: str,
  resource_type: str
)

receivedRequired

  • Type: str

resource_typeRequired

  • Type: str

to_have_provider_with_properties

import cdktn

cdktn.Testing.to_have_provider_with_properties(
  received: str,
  resource_type: str,
  properties: typing.Mapping[typing.Any] = None
)

receivedRequired

  • Type: str

resource_typeRequired

  • Type: str

propertiesOptional

  • Type: typing.Mapping[typing.Any]

to_have_resource

import cdktn

cdktn.Testing.to_have_resource(
  received: str,
  resource_type: str
)

receivedRequired

  • Type: str

resource_typeRequired

  • Type: str

to_have_resource_with_properties

import cdktn

cdktn.Testing.to_have_resource_with_properties(
  received: str,
  resource_type: str,
  properties: typing.Mapping[typing.Any] = None
)

receivedRequired

  • Type: str

resource_typeRequired

  • Type: str

propertiesOptional

  • Type: typing.Mapping[typing.Any]