@aws-cdk/assert#SynthUtils TypeScript Examples

The following examples show how to use @aws-cdk/assert#SynthUtils. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: datadog-dashboard.test.ts    From cdk-datadog-resources with Apache License 2.0 6 votes vote down vote up
test('Snapshot test', () => {
  const stack = new Stack();

  const dashboardDefJson = fs.readFileSync(`${__dirname}/dashboard-def.json`).toString();

  new DatadogDashboard(stack, 'TestMonitor', {
    datadogCredentials: {
      apiKey: 'DATADOG_API_KEY',
      applicationKey: 'DATADOG_APP_KEY',
    },
    dashboardDefinition: dashboardDefJson,
  });

  expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot();
});
Example #2
Source File: datadog-integration.test.ts    From cdk-datadog-resources with Apache License 2.0 6 votes vote down vote up
test('Snapshot test', () => {
  const stack = new Stack();

  new DatadogIntegrationAWS(stack, 'TestIntegration', {
    datadogCredentials: {
      apiKey: 'DATADOG_API_KEY',
      applicationKey: 'DATADOG_APP_KEY',
    },
    accountId: '123456',
    roleName: 'DatadogAWSAcctRoleName',
  });

  expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot();
});
Example #3
Source File: datadog-downtime.test.ts    From cdk-datadog-resources with Apache License 2.0 6 votes vote down vote up
test('Snapshot test', () => {
  const stack = new Stack();

  new DatadogDowntime(stack, 'TestMonitor', {
    datadogCredentials: {
      apiKey: 'DATADOG_API_KEY',
      applicationKey: 'DATADOG_APP_KEY',
    },
    scope: ['host:myserver', 'service:myservice'],
    start: 1624542715,
    end: 1624546321,
  });

  expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot();
});
Example #4
Source File: datadog-monitor.test.ts    From cdk-datadog-resources with Apache License 2.0 6 votes vote down vote up
test('Snapshot test', () => {
  const stack = new Stack();

  new DatadogMonitor(stack, 'TestMonitor', {
    datadogCredentials: {
      apiKey: 'DATADOG_API_KEY',
      applicationKey: 'DATADOG_APP_KEY',
    },
    query: 'avg(last_1h):sum:system.cpu.system{host:host0} > 100',
    type: MonitorType.QUERY_ALERT,
    name: 'Test Monitor',
    options: {
      thresholds: {
        critical: 100,
        warning: 80,
        oK: 90,
      },
      notifyNoData: true,
      evaluationDelay: 60,
    },
  });

  expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot();
});
Example #5
Source File: datadog-user.test.ts    From cdk-datadog-resources with Apache License 2.0 6 votes vote down vote up
test('Snapshot test', () => {
  const stack = new Stack();

  new DatadogIAMUser(stack, 'TestUser', {
  	datadogCredentials: {
      apiKey: 'DATADOG_API_KEY',
      applicationKey: 'DATADOG_APP_KEY',
    },
    email: '[email protected]',
    name: 'name_example',
    handle: 'title_example',
    disabled: false,
  });
  expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot();
});
Example #6
Source File: blue-green-using-ecs.test.ts    From ecs-codepipeline-demo with Apache License 2.0 5 votes vote down vote up
test('Assumable role created in OrgMaster', () => {
    const app = new cdk.App();
    // WHEN
    const stack = new cfnStack.BlueGreenUsingEcsStack(app, 'BlueGreenStep1Stack')
    // THEN
    expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot();
});
Example #7
Source File: integ.snapshot.test.ts    From aws-cdk-for-k3scluster with MIT License 5 votes vote down vote up
test('integ snapshot validation', () => {
  const integ = new IntegTesting();
  integ.stack.forEach(stack => {
    expect(SynthUtils.toCloudFormation(stack)).toMatchSnapshot();
  });
});
Example #8
Source File: test.ts    From aws-cdk-webpack-lambda-function with MIT License 5 votes vote down vote up
test("CloudFormation Test", () => {
  // prepare
  const stack = new TestStack(new App(), "TestStack");
  const resources = SynthUtils.toCloudFormation(stack)["Resources"];
  expect(resources).toMatchSnapshot();
});