> ## 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.

# Typescript: Testing

> CDKTN Core API Reference for Testing in Typescript.

Testing utilities for cdktf applications.

## Initializers <a name="Initializers" id="cdktn.Testing.Initializer" />

```typescript theme={null}
import { Testing } from 'cdktn'

new Testing()
```

| **Name** | **Type** | **Description** |
| -------- | -------- | --------------- |

***

## Static Functions <a name="Static Functions" id="Static Functions" />

| **Name**                                                                                                | **Description**                                                                             |
| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| <code><a href="#cdktn.Testing.app">app</a></code>                                                       | Returns an app for testing with the following properties: - Output directory is a temp dir. |
| <code><a href="#cdktn.Testing.enableFutureFlags">enableFutureFlags</a></code>                           | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.fakeCdktfJsonPath">fakeCdktfJsonPath</a></code>                           | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.fullSynth">fullSynth</a></code>                                           | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.renderConstructTree">renderConstructTree</a></code>                       | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.setupJest">setupJest</a></code>                                           | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.stubVersion">stubVersion</a></code>                                       | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.synth">synth</a></code>                                                   | Returns the Terraform synthesized JSON.                                                     |
| <code><a href="#cdktn.Testing.synthHcl">synthHcl</a></code>                                             | Returns the Terraform synthesized JSON.                                                     |
| <code><a href="#cdktn.Testing.synthScope">synthScope</a></code>                                         | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.toBeValidTerraform">toBeValidTerraform</a></code>                         | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.toHaveDataSource">toHaveDataSource</a></code>                             | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.toHaveDataSourceWithProperties">toHaveDataSourceWithProperties</a></code> | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.toHaveProvider">toHaveProvider</a></code>                                 | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.toHaveProviderWithProperties">toHaveProviderWithProperties</a></code>     | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.toHaveResource">toHaveResource</a></code>                                 | *No description.*                                                                           |
| <code><a href="#cdktn.Testing.toHaveResourceWithProperties">toHaveResourceWithProperties</a></code>     | *No description.*                                                                           |

***

### `app` <a name="app" id="cdktn.Testing.app" />

```typescript theme={null}
import { Testing } from 'cdktn'

Testing.app(options?: TestingAppConfig)
```

Returns an app for testing with the following properties: - Output directory is a temp dir.

#### `options`<sup>Optional</sup> <a name="options" id="cdktn.Testing.app.parameter.options" />

* *Type:* <a href="#cdktn.TestingAppConfig">TestingAppConfig</a>

***

### `enableFutureFlags` <a name="enableFutureFlags" id="cdktn.Testing.enableFutureFlags" />

```typescript theme={null}
import { Testing } from 'cdktn'

Testing.enableFutureFlags(app: App)
```

#### `app`<sup>Required</sup> <a name="app" id="cdktn.Testing.enableFutureFlags.parameter.app" />

* *Type:* <a href="#cdktn.App">App</a>

***

### `fakeCdktfJsonPath` <a name="fakeCdktfJsonPath" id="cdktn.Testing.fakeCdktfJsonPath" />

```typescript theme={null}
import { Testing } from 'cdktn'

Testing.fakeCdktfJsonPath(app: App)
```

#### `app`<sup>Required</sup> <a name="app" id="cdktn.Testing.fakeCdktfJsonPath.parameter.app" />

* *Type:* <a href="#cdktn.App">App</a>

***

### `fullSynth` <a name="fullSynth" id="cdktn.Testing.fullSynth" />

```typescript theme={null}
import { Testing } from 'cdktn'

Testing.fullSynth(stack: TerraformStack)
```

#### `stack`<sup>Required</sup> <a name="stack" id="cdktn.Testing.fullSynth.parameter.stack" />

* *Type:* <a href="#cdktn.TerraformStack">TerraformStack</a>

***

### `renderConstructTree` <a name="renderConstructTree" id="cdktn.Testing.renderConstructTree" />

```typescript theme={null}
import { Testing } from 'cdktn'

Testing.renderConstructTree(construct: IConstruct)
```

#### `construct`<sup>Required</sup> <a name="construct" id="cdktn.Testing.renderConstructTree.parameter.construct" />

* *Type:* constructs.IConstruct

***

### `setupJest` <a name="setupJest" id="cdktn.Testing.setupJest" />

```typescript theme={null}
import { Testing } from 'cdktn'

Testing.setupJest()
```

### `stubVersion` <a name="stubVersion" id="cdktn.Testing.stubVersion" />

```typescript theme={null}
import { Testing } from 'cdktn'

Testing.stubVersion(app: App)
```

#### `app`<sup>Required</sup> <a name="app" id="cdktn.Testing.stubVersion.parameter.app" />

* *Type:* <a href="#cdktn.App">App</a>

***

### `synth` <a name="synth" id="cdktn.Testing.synth" />

```typescript theme={null}
import { Testing } from 'cdktn'

Testing.synth(stack: TerraformStack, runValidations?: boolean)
```

Returns the Terraform synthesized JSON.

#### `stack`<sup>Required</sup> <a name="stack" id="cdktn.Testing.synth.parameter.stack" />

* *Type:* <a href="#cdktn.TerraformStack">TerraformStack</a>

***

#### `runValidations`<sup>Optional</sup> <a name="runValidations" id="cdktn.Testing.synth.parameter.runValidations" />

* *Type:* boolean

***

### `synthHcl` <a name="synthHcl" id="cdktn.Testing.synthHcl" />

```typescript theme={null}
import { Testing } from 'cdktn'

Testing.synthHcl(stack: TerraformStack, runValidations?: boolean, returnMetadata?: boolean)
```

Returns the Terraform synthesized JSON.

#### `stack`<sup>Required</sup> <a name="stack" id="cdktn.Testing.synthHcl.parameter.stack" />

* *Type:* <a href="#cdktn.TerraformStack">TerraformStack</a>

***

#### `runValidations`<sup>Optional</sup> <a name="runValidations" id="cdktn.Testing.synthHcl.parameter.runValidations" />

* *Type:* boolean

***

#### `returnMetadata`<sup>Optional</sup> <a name="returnMetadata" id="cdktn.Testing.synthHcl.parameter.returnMetadata" />

* *Type:* boolean

***

### `synthScope` <a name="synthScope" id="cdktn.Testing.synthScope" />

```typescript theme={null}
import { Testing } from 'cdktn'

Testing.synthScope(fn: IScopeCallback)
```

#### `fn`<sup>Required</sup> <a name="fn" id="cdktn.Testing.synthScope.parameter.fn" />

* *Type:* <a href="#cdktn.IScopeCallback">IScopeCallback</a>

***

### `toBeValidTerraform` <a name="toBeValidTerraform" id="cdktn.Testing.toBeValidTerraform" />

```typescript theme={null}
import { Testing } from 'cdktn'

Testing.toBeValidTerraform(received: string)
```

#### `received`<sup>Required</sup> <a name="received" id="cdktn.Testing.toBeValidTerraform.parameter.received" />

* *Type:* string

***

### `toHaveDataSource` <a name="toHaveDataSource" id="cdktn.Testing.toHaveDataSource" />

```typescript theme={null}
import { Testing } from 'cdktn'

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

#### `received`<sup>Required</sup> <a name="received" id="cdktn.Testing.toHaveDataSource.parameter.received" />

* *Type:* string

***

#### `resourceType`<sup>Required</sup> <a name="resourceType" id="cdktn.Testing.toHaveDataSource.parameter.resourceType" />

* *Type:* string

***

### `toHaveDataSourceWithProperties` <a name="toHaveDataSourceWithProperties" id="cdktn.Testing.toHaveDataSourceWithProperties" />

```typescript theme={null}
import { Testing } from 'cdktn'

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

#### `received`<sup>Required</sup> <a name="received" id="cdktn.Testing.toHaveDataSourceWithProperties.parameter.received" />

* *Type:* string

***

#### `resourceType`<sup>Required</sup> <a name="resourceType" id="cdktn.Testing.toHaveDataSourceWithProperties.parameter.resourceType" />

* *Type:* string

***

#### `properties`<sup>Optional</sup> <a name="properties" id="cdktn.Testing.toHaveDataSourceWithProperties.parameter.properties" />

* *Type:* \{\[ key: string ]: any}

***

### `toHaveProvider` <a name="toHaveProvider" id="cdktn.Testing.toHaveProvider" />

```typescript theme={null}
import { Testing } from 'cdktn'

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

#### `received`<sup>Required</sup> <a name="received" id="cdktn.Testing.toHaveProvider.parameter.received" />

* *Type:* string

***

#### `resourceType`<sup>Required</sup> <a name="resourceType" id="cdktn.Testing.toHaveProvider.parameter.resourceType" />

* *Type:* string

***

### `toHaveProviderWithProperties` <a name="toHaveProviderWithProperties" id="cdktn.Testing.toHaveProviderWithProperties" />

```typescript theme={null}
import { Testing } from 'cdktn'

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

#### `received`<sup>Required</sup> <a name="received" id="cdktn.Testing.toHaveProviderWithProperties.parameter.received" />

* *Type:* string

***

#### `resourceType`<sup>Required</sup> <a name="resourceType" id="cdktn.Testing.toHaveProviderWithProperties.parameter.resourceType" />

* *Type:* string

***

#### `properties`<sup>Optional</sup> <a name="properties" id="cdktn.Testing.toHaveProviderWithProperties.parameter.properties" />

* *Type:* \{\[ key: string ]: any}

***

### `toHaveResource` <a name="toHaveResource" id="cdktn.Testing.toHaveResource" />

```typescript theme={null}
import { Testing } from 'cdktn'

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

#### `received`<sup>Required</sup> <a name="received" id="cdktn.Testing.toHaveResource.parameter.received" />

* *Type:* string

***

#### `resourceType`<sup>Required</sup> <a name="resourceType" id="cdktn.Testing.toHaveResource.parameter.resourceType" />

* *Type:* string

***

### `toHaveResourceWithProperties` <a name="toHaveResourceWithProperties" id="cdktn.Testing.toHaveResourceWithProperties" />

```typescript theme={null}
import { Testing } from 'cdktn'

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

#### `received`<sup>Required</sup> <a name="received" id="cdktn.Testing.toHaveResourceWithProperties.parameter.received" />

* *Type:* string

***

#### `resourceType`<sup>Required</sup> <a name="resourceType" id="cdktn.Testing.toHaveResourceWithProperties.parameter.resourceType" />

* *Type:* string

***

#### `properties`<sup>Optional</sup> <a name="properties" id="cdktn.Testing.toHaveResourceWithProperties.parameter.properties" />

* *Type:* \{\[ key: string ]: any}

***
