diff --git a/test/csharp/synth-app/test.ts b/test/csharp/synth-app/test.ts index af73a60c30..236316d6b4 100644 --- a/test/csharp/synth-app/test.ts +++ b/test/csharp/synth-app/test.ts @@ -10,6 +10,8 @@ describe("csharp full integration test synth", () => { test("synth generates JSON", async () => { await driver.synth(); - expect(driver.synthesizedStack("csharp-simple")).toMatchSnapshot(); + expect( + driver.synthesizedStack("csharp-simple").toString() + ).toMatchSnapshot(); }); }); diff --git a/test/go/synth-app/test.ts b/test/go/synth-app/test.ts index 4563849cc9..a5f4bef356 100644 --- a/test/go/synth-app/test.ts +++ b/test/go/synth-app/test.ts @@ -10,6 +10,6 @@ describe("Go full integration test synth", () => { test("synth generates JSON", async () => { await driver.synth(); - expect(driver.synthesizedStack("go-simple")).toMatchSnapshot(); + expect(driver.synthesizedStack("go-simple").toString()).toMatchSnapshot(); }); }); diff --git a/test/java/synth-app/test.ts b/test/java/synth-app/test.ts index 443c9637d4..78758ae18a 100644 --- a/test/java/synth-app/test.ts +++ b/test/java/synth-app/test.ts @@ -10,6 +10,6 @@ describe("java full integration", () => { test("synth generates JSON", async () => { await driver.synth(); - expect(driver.synthesizedStack("java-simple")).toMatchSnapshot(); + expect(driver.synthesizedStack("java-simple").toString()).toMatchSnapshot(); }); }); diff --git a/test/python/asset/test.ts b/test/python/asset/test.ts index d59a74d703..abfc4b82d9 100644 --- a/test/python/asset/test.ts +++ b/test/python/asset/test.ts @@ -14,22 +14,25 @@ describe("python full integration test assets", () => { test("synth generates JSON and copies files", async () => { await driver.synth(); - expect(driver.synthesizedStack("python-assets")).toMatchSnapshot(); - const stack = JSON.parse(driver.synthesizedStack("python-assets")); + expect( + driver.synthesizedStack("python-assets").toString() + ).toMatchSnapshot(); + const stack = driver.synthesizedStack("python-assets"); expect( fs.readFileSync( path.resolve( driver.stackDirectory("python-assets"), - stack.output.fixtureoutput.value + stack.output("fixtureoutput") ), "utf-8" ) ).toMatchSnapshot(); + const stat = fs.statSync( path.resolve( driver.stackDirectory("python-assets"), - stack.output.fixturesoutput.value + stack.output("fixtureoutput") ) ); expect(stat.isFile()).toBe(true); diff --git a/test/python/multiple-stacks/test.ts b/test/python/multiple-stacks/test.ts index 4c1a6ea40f..dc70c3a918 100644 --- a/test/python/multiple-stacks/test.ts +++ b/test/python/multiple-stacks/test.ts @@ -10,7 +10,11 @@ describe("python full integration test synth", () => { test("synth generates JSON for both stacks", async () => { await driver.synth(); - expect(driver.synthesizedStack("python-simple-one")).toMatchSnapshot(); - expect(driver.synthesizedStack("python-simple-two")).toMatchSnapshot(); + expect( + driver.synthesizedStack("python-simple-one").toString() + ).toMatchSnapshot(); + expect( + driver.synthesizedStack("python-simple-two").toString() + ).toMatchSnapshot(); }); }); diff --git a/test/python/third-party-provider/__snapshots__/test.ts.snap b/test/python/providers/__snapshots__/test.ts.snap similarity index 54% rename from test/python/third-party-provider/__snapshots__/test.ts.snap rename to test/python/providers/__snapshots__/test.ts.snap index 89d45e74ca..fa19b42f3f 100644 --- a/test/python/third-party-provider/__snapshots__/test.ts.snap +++ b/test/python/providers/__snapshots__/test.ts.snap @@ -5,15 +5,15 @@ exports[`python full integration 3rd party synth generates JSON 1`] = ` \\"//\\": { \\"metadata\\": { \\"version\\": \\"stubbed\\", - \\"stackName\\": \\"python-third-party-provider\\", + \\"stackName\\": \\"references\\", \\"backend\\": \\"local\\" } }, \\"terraform\\": { \\"required_providers\\": { \\"docker\\": { - \\"version\\": \\"~> 2.0\\", - \\"source\\": \\"terraform-providers/docker\\" + \\"version\\": \\"~> 2.15\\", + \\"source\\": \\"kreuzwerker/docker\\" } } }, @@ -24,22 +24,22 @@ exports[`python full integration 3rd party synth generates JSON 1`] = ` }, \\"resource\\": { \\"docker_image\\": { - \\"nginxlatest\\": { - \\"keep_locally\\": false, + \\"nginxImage\\": { + \\"keep_locally\\": true, \\"name\\": \\"nginx:latest\\", \\"//\\": { \\"metadata\\": { - \\"path\\": \\"python-third-party-provider/nginx-latest\\", - \\"uniqueId\\": \\"nginxlatest\\" + \\"path\\": \\"references/nginxImage\\", + \\"uniqueId\\": \\"nginxImage\\" } } } }, \\"docker_container\\": { - \\"nginxcdktf\\": { - \\"image\\": \\"\${docker_image.nginxlatest.name}\\", + \\"nginxContainer\\": { + \\"image\\": \\"\${docker_image.nginxImage.repo_digest}\\", \\"name\\": \\"nginx-python-cdktf\\", - \\"privileged\\": false, + \\"privileged\\": \\"\${docker_image.nginxImage.keep_locally}\\", \\"ports\\": [ { \\"external\\": 8000, @@ -48,12 +48,17 @@ exports[`python full integration 3rd party synth generates JSON 1`] = ` ], \\"//\\": { \\"metadata\\": { - \\"path\\": \\"python-third-party-provider/nginx-cdktf\\", - \\"uniqueId\\": \\"nginxcdktf\\" + \\"path\\": \\"references/nginxContainer\\", + \\"uniqueId\\": \\"nginxContainer\\" } } } } + }, + \\"output\\": { + \\"containerCapAdd\\": { + \\"value\\": \\"\${docker_container.nginxContainer.capabilities[0].add}\\" + } } }" `; diff --git a/test/python/third-party-provider/cdktf.json b/test/python/providers/cdktf.json similarity index 82% rename from test/python/third-party-provider/cdktf.json rename to test/python/providers/cdktf.json index 9a05a8ad34..4c1a3a8359 100644 --- a/test/python/third-party-provider/cdktf.json +++ b/test/python/providers/cdktf.json @@ -2,7 +2,7 @@ "language": "python", "app": "pipenv run python main.py", "terraformProviders": [ - "terraform-providers/docker@~> 2.0" + "kreuzwerker/docker@~> 2.15" ], "codeMakerOutput": "imports", "context": { diff --git a/test/python/providers/main.py b/test/python/providers/main.py new file mode 100755 index 0000000000..9e40214fc3 --- /dev/null +++ b/test/python/providers/main.py @@ -0,0 +1,35 @@ +#!/usr/bin/python3 -tt +from constructs import Construct +from cdktf import App, TerraformStack, Testing, TerraformOutput +from imports.docker import Image, Container, DockerProvider + +class References(TerraformStack): + def __init__(self, scope: Construct, ns: str): + super().__init__(scope, ns) + + DockerProvider(self, "provider") + + docker_image = Image(self, 'nginxImage', name='nginx:latest', keep_locally=False) + + # Simple References + container = Container(self, 'nginxContainer', name='nginx-python-cdktf', + image=docker_image.repo_digest, ports=[ + { + 'internal': 80, + 'external': 8000 + }], privileged=False) + # Single-item References + TerraformOutput(self, "containerCapAdd", value=container.capabilities.add) + + # Direct Mutation + docker_image.keep_locally = True + + # Reference Mutation + container.privileged = docker_image.keep_locally + + + +app = Testing.stub_version(App(stack_traces=False)) +References(app, "references") + +app.synth() diff --git a/test/python/providers/test.ts b/test/python/providers/test.ts new file mode 100644 index 0000000000..02d9a3b66a --- /dev/null +++ b/test/python/providers/test.ts @@ -0,0 +1,43 @@ +import { TestDriver } from "../../test-helper"; + +describe("python full integration 3rd party", () => { + let driver: TestDriver; + + beforeAll(async () => { + driver = new TestDriver(__dirname); + await driver.setupPythonProject(); + await driver.synth(); + }); + + test("synth generates JSON", async () => { + expect(driver.synthesizedStack("references").toString()).toMatchSnapshot(); + }); + + describe("references", () => { + test("simple references", () => { + expect( + driver.synthesizedStack("references").byId("nginxContainer").image + ).toContain("nginxImage.repo_digest"); + }); + + test("single-item references", () => { + expect( + driver.synthesizedStack("references").output("containerCapAdd") + ).toContain("nginxContainer.capabilities[0].add"); + }); + }); + + describe("mutation", () => { + test("direct mutation", () => { + expect( + driver.synthesizedStack("references").byId("nginxImage").keep_locally + ).toBeTruthy(); + }); + + test("reference mutation", () => { + expect( + driver.synthesizedStack("references").byId("nginxContainer").privileged + ).toContain("nginxImage.keep_locally"); + }); + }); +}); diff --git a/test/python/synth-app/test.ts b/test/python/synth-app/test.ts index 14533e0c74..e109b8ca92 100644 --- a/test/python/synth-app/test.ts +++ b/test/python/synth-app/test.ts @@ -10,6 +10,8 @@ describe("python full integration test synth", () => { test("synth generates JSON", async () => { await driver.synth(); - expect(driver.synthesizedStack("python-simple")).toMatchSnapshot(); + expect( + driver.synthesizedStack("python-simple").toString() + ).toMatchSnapshot(); }); }); diff --git a/test/python/terraform-functions/test.ts b/test/python/terraform-functions/test.ts index a5885a63cf..1f1ea1dd18 100644 --- a/test/python/terraform-functions/test.ts +++ b/test/python/terraform-functions/test.ts @@ -10,6 +10,8 @@ describe("python terraform functions test synth", () => { test("synth generates JSON", async () => { await driver.synth(); - expect(driver.synthesizedStack("python-simple")).toMatchSnapshot(); + expect( + driver.synthesizedStack("python-simple").toString() + ).toMatchSnapshot(); }); }); diff --git a/test/python/third-party-provider/main.py b/test/python/third-party-provider/main.py deleted file mode 100755 index f5a9edf67c..0000000000 --- a/test/python/third-party-provider/main.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/python3 -tt -from constructs import Construct -from cdktf import App, TerraformStack, Testing -from imports.docker import Image, Container, DockerProvider - -class MyStack(TerraformStack): - def __init__(self, scope: Construct, ns: str): - super().__init__(scope, ns) - - DockerProvider(self, "provider") - - docker_image = Image(self, 'nginx-latest', name='nginx:latest', keep_locally=False) - - Container(self, 'nginx-cdktf', name='nginx-python-cdktf', - image=docker_image.name, ports=[ - { - 'internal': 80, - 'external': 8000 - }], privileged=False) - - -app = Testing.stub_version(App(stack_traces=False)) -MyStack(app, "python-third-party-provider") - -app.synth() diff --git a/test/python/third-party-provider/test.ts b/test/python/third-party-provider/test.ts deleted file mode 100644 index 86b843c97a..0000000000 --- a/test/python/third-party-provider/test.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { TestDriver } from "../../test-helper"; - -describe("python full integration 3rd party", () => { - let driver: TestDriver; - - beforeAll(async () => { - driver = new TestDriver(__dirname); - await driver.setupPythonProject(); - }); - - test("synth generates JSON", async () => { - await driver.synth(); - expect( - driver.synthesizedStack("python-third-party-provider") - ).toMatchSnapshot(); - }); -}); diff --git a/test/test-helper.ts b/test/test-helper.ts index db3d1e61ec..a7f3cf745f 100644 --- a/test/test-helper.ts +++ b/test/test-helper.ts @@ -8,6 +8,39 @@ const path = require("path"); const fs = require("fs"); const fse = require("fs-extra"); +class QueryableStack { + private readonly stack: Record; + constructor(stackInput: string) { + this.stack = JSON.parse(stackInput); + } + + /** + * Returns the construct with the given ID in the stack, no matter if + * it's a data source or resource and which type it has + */ + public byId(id: string): Record { + const constructs = ( + [ + ...Object.values(this.stack.resource || {}), + ...Object.values(this.stack.data || {}), + ] as Record[] + ).reduce( + (carry, item) => ({ ...carry, ...item }), + {} as Record + ); + + return constructs[id]; + } + + public output(id: string): string { + return this.stack.output[id].value; + } + + public toString(): string { + return JSON.stringify(this.stack, null, 2); + } +} + export class TestDriver { public env: Record; public workingDirectory: string; @@ -91,9 +124,11 @@ export class TestDriver { }; synthesizedStack = (stackName: string) => { - return fs.readFileSync( - path.join(this.stackDirectory(stackName), "cdk.tf.json"), - "utf-8" + return new QueryableStack( + fs.readFileSync( + path.join(this.stackDirectory(stackName), "cdk.tf.json"), + "utf-8" + ) ); }; diff --git a/test/typescript/asset/test.ts b/test/typescript/asset/test.ts index ce043cef82..1841f4d960 100644 --- a/test/typescript/asset/test.ts +++ b/test/typescript/asset/test.ts @@ -14,7 +14,7 @@ describe("full integration test", () => { test("synth", async () => { await driver.synth("fixed"); - expect(driver.synthesizedStack("fixed")).toMatchSnapshot(); + expect(driver.synthesizedStack("fixed").toString()).toMatchSnapshot(); }); test("file asset copied", async () => { diff --git a/test/typescript/modules/test.ts b/test/typescript/modules/test.ts index afad517557..8a31635f77 100755 --- a/test/typescript/modules/test.ts +++ b/test/typescript/modules/test.ts @@ -19,11 +19,15 @@ describe("full integration test", () => { onPosix("build modules posix", async () => { await driver.synth(); - expect(driver.synthesizedStack("hello-modules")).toMatchSnapshot(); + expect( + driver.synthesizedStack("hello-modules").toString() + ).toMatchSnapshot(); }); onWindows("build modules windows", async () => { await driver.synth(); - expect(driver.synthesizedStack("hello-modules")).toMatchSnapshot(); + expect( + driver.synthesizedStack("hello-modules").toString() + ).toMatchSnapshot(); }); }); diff --git a/test/typescript/multiple-stacks/test.ts b/test/typescript/multiple-stacks/test.ts index fbef68925c..6d06b219fa 100644 --- a/test/typescript/multiple-stacks/test.ts +++ b/test/typescript/multiple-stacks/test.ts @@ -10,8 +10,8 @@ describe("full integration test", () => { test("synth", async () => { await driver.synth(); - expect(driver.synthesizedStack("first")).toMatchSnapshot(); - expect(driver.synthesizedStack("second")).toMatchSnapshot(); + expect(driver.synthesizedStack("first").toString()).toMatchSnapshot(); + expect(driver.synthesizedStack("second").toString()).toMatchSnapshot(); }); test("synth with json output", async () => { diff --git a/test/typescript/providers/__snapshots__/test.ts.snap b/test/typescript/providers/__snapshots__/test.ts.snap index f825653589..ec5d619699 100644 --- a/test/typescript/providers/__snapshots__/test.ts.snap +++ b/test/typescript/providers/__snapshots__/test.ts.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`full integration test build providers 1`] = ` -"Deploying Stack: hello-deploy +"Deploying Stack: using-all-providers Resources ✔ NULL_RESOURCE test null_resource.test diff --git a/test/typescript/providers/main.ts b/test/typescript/providers/main.ts index 8f034599be..d416bd62e7 100644 --- a/test/typescript/providers/main.ts +++ b/test/typescript/providers/main.ts @@ -1,5 +1,11 @@ import { Construct } from "constructs"; -import { App, TerraformStack, Testing } from "cdktf"; +import { + App, + TerraformOutput, + TerraformStack, + TerraformVariable, + Testing, +} from "cdktf"; import * as NullProvider from "./.gen/providers/null"; import * as Aws from "./.gen/providers/aws"; import * as Azure from "./.gen/providers/azurerm"; @@ -11,7 +17,7 @@ import * as Vault from "./.gen/providers/vault"; import * as Consul from "./.gen/providers/consul"; import * as External from "./.gen/providers/external"; -export class HelloTerra extends TerraformStack { +export class UsingAllProviders extends TerraformStack { constructor(scope: Construct, id: string) { super(scope, id); new NullProvider.NullProvider(this, "null", {}); @@ -30,6 +36,207 @@ export class HelloTerra extends TerraformStack { } } +export class NamespacedProviders extends TerraformStack { + constructor(scope: Construct, id: string) { + super(scope, id); + new Aws.AwsProvider(this, "aws", { + region: "us-east-1", + }); + + const ami = new Aws.EC2.DataAwsAmi(this, "ami", { + mostRecent: true, + owners: ["amazon"], + }); + + new Aws.EC2.Instance(this, "instance", { + ami: ami.id, + availabilityZone: "us-east-1a", + instanceType: "t2.micro", + }); + + const userId = new Aws.DataSources.DataAwsCallerIdentity( + this, + "callerIdentity", + {} + ); + new Aws.LambdaFunction.LambdaFunction(this, "lambdaFn", { + handler: "index.handler", + runtime: "nodejs12.x", + timeout: 10, + functionName: userId.accountId, + role: new Aws.IAM.IamRole(this, "role", { + assumeRolePolicy: "assumeRolePolicy", + }).arn, + }); + } +} + +export class References extends TerraformStack { + constructor(scope: Construct, id: string) { + super(scope, id); + + const provider = new Nomad.NomadProvider(this, "nomad", { + address: "http://127.0.0.1", + }); + // provider values are no references + new TerraformOutput(this, "provideraddress", { + value: provider.address, + }); + + // simple references + const job = new Nomad.JobA(this, "firstJob", { + jobspec: "./job/spec.hcl", + }); + + new Nomad.JobA(this, "secondJob", { + jobspec: job.jobspec, + }); + + // single-item references + new Kubernetes.KubernetesProvider(this, "k8s", {}); + const namespace = new Kubernetes.NamespaceA(this, "myNamespace", { + metadata: { name: "myNamespace" }, + }); + + new Kubernetes.Deployment(this, "myDeployment", { + metadata: { + name: "myDeployment", + namespace: namespace.metadata.name, + }, + spec: { + replicas: "1", + selector: { + matchLabels: { + app: "myDeployment", + }, + }, + template: { + metadata: { + labels: { + app: "myDeployment", + }, + }, + spec: { + container: [ + { + name: "myDeployment", + image: "nginx", + }, + ], + }, + }, + }, + }); + } +} + +export class Mutation extends TerraformStack { + constructor(scope: Construct, id: string) { + super(scope, id); + + const namespace = new TerraformVariable(this, "namespace", { + type: "string", + default: "default", + }).stringValue; + + // Simple Mutation + new Aws.AwsProvider(this, "aws", { + region: "us-east-1", + }); + + const ami = new Aws.EC2.DataAwsAmi(this, "ami", { + mostRecent: true, + owners: ["amazon"], + }); + + const instance = new Aws.EC2.Instance(this, "instance", { + ami: "my-ami", + availabilityZone: "us-east-1a", + instanceType: "t2.micro", + }); + + // direct primitive mutation + instance.instanceType = "t2.small"; + + // direct reference mutation + instance.ami = ami.id; + + // reset method mutation + instance.resetAvailabilityZone(); + + // put method mutation + instance.putMetadataOptions({ httpEndpoint: "127.0.0.1" }); + + // Nested Mutation + new Kubernetes.KubernetesProvider(this, "k8s", {}); + const deployment = new Kubernetes.Deployment(this, "myDeployment", { + metadata: { name: "myDeployment" }, + spec: { + replicas: "1", + minReadySeconds: 42, + selector: { + matchLabels: { + app: "myDeployment", + }, + }, + template: { + metadata: { + labels: { + app: "myDeployment", + }, + }, + spec: { + container: [ + { + name: "myDeployment", + image: "nginx", + }, + ], + }, + }, + }, + }); + + // direct primitive mutation + deployment.spec.replicas = "2"; + + // direct reference mutation + deployment.metadata.namespace = namespace; + + // reset method mutation + deployment.spec.resetMinReadySeconds(); + + // put method mutation + deployment.spec.putStrategy({ + rollingUpdate: { + maxSurge: "10%", + maxUnavailable: "10%", + }, + }); + + // object mutation (not yet supported + // deployment.spec.selector = { + // matchLabels: { + // app: "my-other-deployment", + // }, + // } + + // list mutation (not yet supported) + // const containerImage = new TerraformVariable(this, "containerImage", { + // type: "string", + // default: "nginix", + // }).stringValue; + + // deployment.spec.template.spec.container?.push({ + // name: "my-other-container", + // image: containerImage, + // }); + } +} + const app = Testing.stubVersion(new App({})); -new HelloTerra(app, "hello-deploy"); +new UsingAllProviders(app, "using-all-providers"); +new NamespacedProviders(app, "namespaces"); +new References(app, "references"); +new Mutation(app, "mutation"); app.synth(); diff --git a/test/typescript/providers/test.ts b/test/typescript/providers/test.ts index 921c9b9d2c..1ef706159e 100755 --- a/test/typescript/providers/test.ts +++ b/test/typescript/providers/test.ts @@ -9,6 +9,115 @@ describe("full integration test", () => { }); test("build providers", () => { - expect(driver.deploy()).toMatchSnapshot(); + expect(driver.deploy("using-all-providers")).toMatchSnapshot(); + }); + + describe("namespaces", () => { + let stack; + beforeAll(() => { + stack = driver.synthesizedStack("namespaces"); + }); + + test("has resources", () => { + expect(stack.byId("instance")).toBeTruthy(); + expect(stack.byId("lambdaFn")).toBeTruthy(); + }); + + test("has data source", () => { + expect(stack.byId("ami")).toBeTruthy(); + expect(stack.byId("callerIdentity")).toBeTruthy(); + }); + }); + + describe("provider functionality", () => { + beforeAll(async () => { + await driver.synth(); + }); + + describe("references", () => { + let stack; + beforeAll(() => { + stack = driver.synthesizedStack("references"); + }); + + // HCL does not support referencing provider values + test("provider references are no references", () => { + const providerAddress = stack.output("provideraddress"); + expect(providerAddress).toEqual("http://127.0.0.1"); + }); + + test("simple references", () => { + const jobSpec = stack.byId("secondJob").jobspec; + expect(jobSpec).toContain("${"); + expect(jobSpec).toContain("firstJob"); + expect(jobSpec).toContain("jobspec"); + }); + + test("single-item references", () => { + const namespace = stack.byId("myDeployment").metadata.namespace; + expect(namespace).toContain("${"); + expect(namespace).toContain("myNamespace"); + expect(namespace).toContain(".metadata[0].name"); + }); + }); + + describe("mutation", () => { + describe("Simple", () => { + let instance; + beforeAll(() => { + instance = driver.synthesizedStack("mutation").byId("instance"); + }); + + test("direct primitive mutation", () => { + expect(instance.instance_type).toBe("t2.small"); + }); + + test("direct reference mutation", () => { + expect(instance.ami).toEqual("${data.aws_ami.ami.id}"); + }); + + test("reset method mutation", () => { + expect(instance.availability_zone).not.toBeDefined(); + }); + + test("put method mutation", () => { + expect(instance.metadata_options).toEqual({ + http_endpoint: "127.0.0.1", + }); + }); + }); + + // The necessary functions are exposed, but currently do not work + // See https://github.com/hashicorp/terraform-cdk/issues/1246 + describe.skip("single-item nesting", () => { + let deployment; + beforeAll(() => { + deployment = driver.synthesizedStack("mutation").byId("myDeployment"); + }); + test("direct primitive mutation", () => { + expect(deployment.spec.replicas).toBe("2"); + }); + + test("direct reference mutation", () => { + expect(deployment.metadata.namespace).toContain("${"); + expect(deployment.metadata.namespace).toContain("var."); + expect(deployment.metadata.namespace).toContain("namespace"); + }); + + test("reset method mutation", () => { + expect(deployment.spec.min_ready_seconds).not.toBeDefined(); + }); + + test("put method mutation", () => { + expect(deployment.spec.strategy).toEqual({ + type: "RollingUpdate", + rolling_update: { + max_surge: "10%", + max_unavailable: "10%", + }, + }); + }); + }); + }); }); }); diff --git a/test/typescript/synth-app/test.ts b/test/typescript/synth-app/test.ts index 6e19a85a06..727b873b41 100644 --- a/test/typescript/synth-app/test.ts +++ b/test/typescript/synth-app/test.ts @@ -10,10 +10,6 @@ describe("full integration test synth", () => { }); test("synth generates JSON", () => { - expect(driver.synthesizedStack("hello-terra")).toMatchSnapshot(); + expect(driver.synthesizedStack("hello-terra").toString()).toMatchSnapshot(); }); - - // test("object references resolve to right source", ()=> { - - // }) });