@cloudcomponents/jest-cdk-snapshotdeprecated

Jest matcher for cdk cloudformation comparisons.

Usage no npm install needed!

<script type="module">
  import cloudcomponentsJestCdkSnapshot from 'https://cdn.skypack.dev/@cloudcomponents/jest-cdk-snapshot';
</script>

README

@cloudcomponents/jest-cdk-snapshot

Jest matcher for cdk cloudformation comparisons.

Install

npm install --save-dev @cloudcomponents/jest-cdk-snapshot

How to use

import { Stack } from '@aws-cdk/core';
import { GithubWebhook } from '@cloudcomponents/cdk-github-webhook';
import '@cloudcomponents/jest-cdk-snapshot';

describe('cdk-github-webhook', () => {
  it('snapshot', () => {
    const stack = new Stack();

    new GithubWebhook(stack, 'GithubWebhook', {
      githubApiToken: 'test12',
      githubRepoUrl: 'test',
      payloadUrl: 'test',
      events: ['test']
    });

    expect(stack).toMatchCdkSnapshot();
  });
});

Use YAML as snapshot format

import { Stack } from '@aws-cdk/core';
import { GithubWebhook } from '@cloudcomponents/cdk-github-webhook';
import '@cloudcomponents/jest-cdk-snapshot';

describe('cdk-github-webhook', () => {
  it('snapshot', () => {
    const stack = new Stack();

    new GithubWebhook(stack, 'GithubWebhook', {
      githubApiToken: 'test12',
      githubRepoUrl: 'test',
      payloadUrl: 'test',
      events: ['test']
    });

    expect(stack).toMatchCdkSnapshot({ yaml: true });
  });
});

License

MIT