Skip to content

Commit

Permalink
chore(docs): use Synth than SynthScope for hashicorp#2755
Browse files Browse the repository at this point in the history
Modify docs for beginners, in hashicorp#2755.
  • Loading branch information
tolluset authored Apr 2, 2023
1 parent ff98f40 commit 5042f74
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions website/docs/cdktf/test/unit-tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ import MyApplicationsAbstraction from "../app"; // Could be a class extending fr
describe("Unit testing using assertions", () => {
it("should contain a container", () => {
expect(
Testing.synthScope((scope) => {
new MyApplicationsAbstraction(scope, "my-app", {});
})
).toHaveResource(Container);
const app = Testing.app();
const stack = new MyApplicationsAbstraction(app, "my-app", {});
const synthesized = Testing.synth(stack);
expect(synthesized).toHaveResource(Container);
});
it("should use an ubuntu image", () => {
expect(
Testing.synthScope((scope) => {
new MyApplicationsAbstraction(scope, "my-app", {});
})
).toHaveResourceWithProperties(Image, { name: "ubuntu:latest" });
const app = Testing.app();
const stack = new MyApplicationsAbstraction(app, "my-app", {});
const synthesized = Testing.synth(stack);
expect(synthesized).toHaveResourceWithProperties(Image, { name: "ubuntu:latest" });
});
});
```
Expand Down

0 comments on commit 5042f74

Please sign in to comment.