-
Notifications
You must be signed in to change notification settings - Fork 296
/
Copy pathmain-test.ts
89 lines (74 loc) · 2.68 KB
/
main-test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Copyright (c) HashiCorp, Inc
// SPDX-License-Identifier: MPL-2.0
import "cdktf/lib/testing/adapters/jest"; // Load types for expect matchers
// import { Testing } from "cdktf";
describe("My CDKTF Application", () => {
// The tests below are example tests, you can find more information at
// https://cdk.tf/testing
it.todo("should be tested");
// // All Unit tests test the synthesised terraform code, it does not create real-world resources
// describe("Unit testing using assertions", () => {
// it("should contain a resource", () => {
// // import { Image,Container } from "./.gen/providers/docker"
// expect(
// Testing.synthScope((scope) => {
// new MyApplicationsAbstraction(scope, "my-app", {});
// })
// ).toHaveResource(Container);
// expect(
// Testing.synthScope((scope) => {
// new MyApplicationsAbstraction(scope, "my-app", {});
// })
// ).toHaveResourceWithProperties(Image, { name: "ubuntu:latest" });
// });
// });
// describe("Unit testing using snapshots", () => {
// it("Tests the snapshot", () => {
// const app = Testing.app();
// const stack = new TerraformStack(app, "test");
// new TestProvider(stack, "provider", {
// accessKey: "1",
// });
// new TestResource(stack, "test", {
// name: "my-resource",
// });
// expect(Testing.synth(stack)).toMatchSnapshot();
// });
// it("Tests a combination of resources", () => {
// expect(
// Testing.synthScope((stack) => {
// new TestDataSource(stack, "test-data-source", {
// name: "foo",
// });
// new TestResource(stack, "test-resource", {
// name: "bar",
// });
// })
// ).toMatchInlineSnapshot();
// });
// });
// describe("Checking validity", () => {
// it("check if the produced terraform configuration is valid", () => {
// const app = Testing.app();
// const stack = new TerraformStack(app, "test");
// new TestDataSource(stack, "test-data-source", {
// name: "foo",
// });
// new TestResource(stack, "test-resource", {
// name: "bar",
// });
// expect(Testing.fullSynth(app)).toBeValidTerraform();
// });
// it("check if this can be planned", () => {
// const app = Testing.app();
// const stack = new TerraformStack(app, "test");
// new TestDataSource(stack, "test-data-source", {
// name: "foo",
// });
// new TestResource(stack, "test-resource", {
// name: "bar",
// });
// expect(Testing.fullSynth(app)).toPlanSuccessfully();
// });
// });
});