# cdk-image-testing

> This is a simple tool to build container images in a CDK application for testing.

Latest version **0.3.0** (published 2023-07-27) · 0 weekly downloads

## Install

```sh
npm install cdk-image-testing
pnpm add cdk-image-testing
yarn add cdk-image-testing
bun add cdk-image-testing
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2023-07-27 |
| First published | 2023-06-12 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 42.8 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | theocowan |

## Links

- npm: https://www.npmjs.com/package/cdk-image-testing
- Repository: https://github.com/deuscapturus/cdk-image-testing
- Homepage: https://github.com/deuscapturus/cdk-image-testing#readme
- Issues: https://github.com/deuscapturus/cdk-image-testing/issues
- npm.io page: https://npm.io/package/cdk-image-testing

## Dependencies (3)

- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.1396.0
- [cdk-assets](https://npm.io/package/cdk-assets.md) ^2.83.1
- [aws-cdk-lib](https://npm.io/package/aws-cdk-lib.md) ^2.83.1

## Recent versions

- 0.3.0 (latest) — 2023-07-27
- 0.2.4 — 2023-07-18
- 0.2.3 — 2023-06-16
- 0.2.2 — 2023-06-14
- 0.2.1 — 2023-06-13
- 0.2.0 — 2023-06-13
- 0.1.0 — 2023-06-12

## README

# cdk-image-testing

This is a simple tool to build container images in a CDK application for testing.

## Setup

```
npm install --save-dev cdk-image-testing
```

## Usage

```typescript
import { ImageAssetTesting } from "cdk-image-testing"
import { spawnSync } from 'child_process'

// set jest timeout to 5 minutes
jest.setTimeout(5 * 60 * 1000)

describe('test-image-asset-build', () => {
  const app = new App();
  const stack = new Stack(app, 'test-stack');
  
  // Add construct with container image assets here.
  // This test assumes Dockerfile has a build target called "test".

  const assembly = app.synth()
  const imageAssets = new ImageAssetTesting(assembly.directory)

  test('pytest', async () => {
      const imageTags = await imageAssets.buildAll("test")

      for (let tag of imageTags) {
          const result = spawnSync('docker', ['run', '--network', 'host', tag], { stdio: 'inherit' });
          expect(result.status).toBe(0);
      }        
  })
})
```

---
_Source: https://npm.io/package/cdk-image-testing · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
