diff options
Diffstat (limited to 'cli/tools/init/templates')
| -rw-r--r-- | cli/tools/init/templates/main.ts | 8 | ||||
| -rw-r--r-- | cli/tools/init/templates/main_test.ts | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/cli/tools/init/templates/main.ts b/cli/tools/init/templates/main.ts new file mode 100644 index 000000000..be043e97c --- /dev/null +++ b/cli/tools/init/templates/main.ts @@ -0,0 +1,8 @@ +export function add(a: number, b: number): number { + return a + b; +} + +// Learn more at https://deno.land/manual/examples/module_metadata#concepts +if (import.meta.main) { + console.log("Add 2 + 3 =", add(2, 3)); +} diff --git a/cli/tools/init/templates/main_test.ts b/cli/tools/init/templates/main_test.ts new file mode 100644 index 000000000..5f60b571c --- /dev/null +++ b/cli/tools/init/templates/main_test.ts @@ -0,0 +1,6 @@ +import { assertEquals } from "{CURRENT_STD_URL}testing/asserts.ts"; +import { add } from "./main.ts"; + +Deno.test(function addTest() { + assertEquals(add(2, 3), 5); +}); |
