diff --git a/package-lock.json b/package-lock.json index be809f4..6b3edd4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "cdk8s-plus-27": "^2.7.33", "cdktf": "^0.18.2", "glob": "^10.3.10", - "winglang": "^0.44.2" + "winglang": "^0.44.3" } }, "node_modules/@cdktf/provider-aws": { @@ -698,22 +698,22 @@ "optional": true }, "node_modules/@wingconsole/app": { - "version": "0.44.2", - "resolved": "https://registry.npmjs.org/@wingconsole/app/-/app-0.44.2.tgz", - "integrity": "sha512-DZO/Ct2Ks46CBRR6+UgL9AE8Pn6FT2TOSFJznZj4nFrqXLqIs9BOUggJ9fzXJBjrGA5SsK80wzo4t6mAF7raeQ==", + "version": "0.44.3", + "resolved": "https://registry.npmjs.org/@wingconsole/app/-/app-0.44.3.tgz", + "integrity": "sha512-wM41dSNEx6oKcgXDZ9+szGc27MemFTF9GpDzUkwG33e/1SXhLOPcfD5st97yF25Na8bkupKfyA7nu8CzDVD4aA==", "dependencies": { "@segment/analytics-node": "^1.1.0", - "@wingconsole/server": "0.44.2", + "@wingconsole/server": "0.44.3", "express": "^4.18.2" } }, "node_modules/@wingconsole/server": { - "version": "0.44.2", - "resolved": "https://registry.npmjs.org/@wingconsole/server/-/server-0.44.2.tgz", - "integrity": "sha512-FrKvhL4cHZszrkVYvO7ydEUBvYbI7EcJ4X2lAXKPgtkQIUlS3e/zoWJMGyRyiVB0IX4nuama505NSmC13UFivg==", + "version": "0.44.3", + "resolved": "https://registry.npmjs.org/@wingconsole/server/-/server-0.44.3.tgz", + "integrity": "sha512-QpMHDpR26WQ9p5D9f95i+vp1S0oQZzHjR8M4nmcmOYDMgpHG+vFVa1ZDw7LO8ClwzQbFpLfx+scpl9B9Z0tABg==", "dependencies": { - "@winglang/compiler": "0.44.2", - "@winglang/sdk": "0.44.2", + "@winglang/compiler": "0.44.3", + "@winglang/sdk": "0.44.3", "codespan-wasm": "^0.4.0", "debug": "^4.3.4", "launch-editor": "^2.6.0", @@ -721,14 +721,14 @@ } }, "node_modules/@winglang/compiler": { - "version": "0.44.2", - "resolved": "https://registry.npmjs.org/@winglang/compiler/-/compiler-0.44.2.tgz", - "integrity": "sha512-4GtE3TmVb0lccQIyhkUFWjvFp1Ht132DH0DqoADfmuGXHQoZLsnImwZDdoOsrhQtj+ETGE/CUIYdQcG+JMO/4w==", + "version": "0.44.3", + "resolved": "https://registry.npmjs.org/@winglang/compiler/-/compiler-0.44.3.tgz", + "integrity": "sha512-QqKu0sjIoMQ6LgmgrjtA3WksNJHwka/3FG8CQYLvUw4z+X0Csz7kGLHoekNh94NOJWh33TDmGjThTcCMdUdfhQ==", "bundleDependencies": [ "wasi-js" ], "dependencies": { - "@winglang/sdk": "0.44.2", + "@winglang/sdk": "0.44.3", "wasi-js": "^1.7.3" }, "engines": { @@ -862,9 +862,9 @@ } }, "node_modules/@winglang/sdk": { - "version": "0.44.2", - "resolved": "https://registry.npmjs.org/@winglang/sdk/-/sdk-0.44.2.tgz", - "integrity": "sha512-zPfLFSLocuxuQ1WPMEcVoC8KRWtFODF627dW2DXMq21juDbWcIknOvDjPrB2hub4J613VGOvLPjCtgGxSmps+w==", + "version": "0.44.3", + "resolved": "https://registry.npmjs.org/@winglang/sdk/-/sdk-0.44.3.tgz", + "integrity": "sha512-fqsVeY+ZjpbZoLD4g4LRgsn/EA3+d5B2e8STDz4ZAesT+S9ts+rPVtpfMTcJar4bpqzD36amcU0MHKFQ74tEkw==", "bundleDependencies": [ "@aws-sdk/client-cloudwatch-logs", "@aws-sdk/client-dynamodb", @@ -9989,16 +9989,16 @@ } }, "node_modules/winglang": { - "version": "0.44.2", - "resolved": "https://registry.npmjs.org/winglang/-/winglang-0.44.2.tgz", - "integrity": "sha512-LRu/0STlABky353/2nw5z5jD9NzK8rHPWMQMzaCbsgJlL21uUzY5Zi1HDERpslghmLNnAFP5stTGTf+NIicxJw==", + "version": "0.44.3", + "resolved": "https://registry.npmjs.org/winglang/-/winglang-0.44.3.tgz", + "integrity": "sha512-BfUCAfDNqXj3NemdOCDxRRYY8bum3tGRA9LQnZpkLA4+pDD7l1korsNlASkAHSuo8VYvHL4XcUnucqp1C0uFsw==", "dependencies": { "@npmcli/arborist": "^7.2.0", "@segment/analytics-node": "^1.1.0", - "@wingconsole/app": "0.44.2", - "@wingconsole/server": "0.44.2", - "@winglang/compiler": "0.44.2", - "@winglang/sdk": "0.44.2", + "@wingconsole/app": "0.44.3", + "@wingconsole/server": "0.44.3", + "@winglang/compiler": "0.44.3", + "@winglang/sdk": "0.44.3", "chalk": "^4.1.2", "codespan-wasm": "0.4.0", "commander": "^10.0.1", diff --git a/package.json b/package.json index a70aef8..2cdf93d 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,6 @@ "cdk8s-plus-27": "^2.7.33", "cdktf": "^0.18.2", "glob": "^10.3.10", - "winglang": "^0.44.2" + "winglang": "^0.44.3" } } diff --git a/test/containers.test.w b/test/containers.test.w index b715603..d53dba2 100644 --- a/test/containers.test.w +++ b/test/containers.test.w @@ -16,7 +16,7 @@ let hello = new containers.Workload( public: true, ) as "hello"; -new containers.Workload( +let echo = new containers.Workload( name: "http-echo", image: "hashicorp/http-echo", port: 5678, @@ -25,14 +25,20 @@ new containers.Workload( args: ["-text=hello1234"], ) as "http-echo"; -let tryGetBody = inflight (): str? => { +let httpGet = inflight (url: str?): str => { + if let url = url { + if let body = http.get(url).body { + return body; + } + } + + throw "no body"; }; -test "ping" { - if let url = hello.publicUrl { - let body = http.get(url).body; - assert(body?.contains(message) ?? false); - } else { - assert(false); - } +test "access public url" { + let helloBody = httpGet(hello.publicUrl); + assert(helloBody.contains(message)); + + let echoBody = httpGet(echo.publicUrl); + assert(echoBody.contains("hello1234")); }