From bf69e293cba48c4ac311b14d30c2976a94b58289 Mon Sep 17 00:00:00 2001 From: Nathan Tarbert <66887028+NathanTarbert@users.noreply.github.com> Date: Sun, 5 May 2024 07:54:38 -0400 Subject: [PATCH] chore(docs): update TypeScript example in the `Testing` section (#6403) `cloud.Function` is missing the keyword `new`. Added to the code below. ```ts import { main, cloud, inflight, lift } from "@wingcloud/framework"; import assert from "node:assert"; main((root, test) => { const fn = new cloud.Function( root, "MyFn", inflight(async () => { return "Wing!"; }) ); test( // name of the test "MyFn returns 'Wing!'", // inflight function to run as the test lift({ fn }).inflight(async ({ fn }) => { assert.equal(await fn.invoke(), "Wing!"); }) ); }); ``` ## Checklist - [x] Title matches [Winglang's style guide](https://www.winglang.io/contributing/start-here/pull_requests#how-are-pull-request-titles-formatted) - [x] Description explains motivation and solution - [x] Tests added (always) - [ ] Docs updated (only required for features) - [ ] Added `pr/e2e-full` label if this feature requires end-to-end testing *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*. --- docs/docs/09-typescript/02-inflights.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs/09-typescript/02-inflights.md b/docs/docs/09-typescript/02-inflights.md index 2dc92cb3490..1f628a7237b 100644 --- a/docs/docs/09-typescript/02-inflights.md +++ b/docs/docs/09-typescript/02-inflights.md @@ -116,7 +116,7 @@ import { main, cloud, inflight, lift } from "@wingcloud/framework"; import assert from "node:assert"; main((root, test) => { - const fn = cloud.Function( + const fn = new cloud.Function( root, "MyFn", inflight(async () => {