From 6de2f553709ddd9bea104b49662a062e65609525 Mon Sep 17 00:00:00 2001 From: Will Date: Mon, 3 Feb 2025 17:09:48 -0500 Subject: [PATCH] init --- deno.json | 8 ++++++++ main.ts | 8 ++++++++ main_test.ts | 6 ++++++ 3 files changed, 22 insertions(+) create mode 100644 deno.json create mode 100644 main.ts create mode 100644 main_test.ts diff --git a/deno.json b/deno.json new file mode 100644 index 0000000..5b320c2 --- /dev/null +++ b/deno.json @@ -0,0 +1,8 @@ +{ + "tasks": { + "dev": "deno run --watch main.ts" + }, + "imports": { + "@std/assert": "jsr:@std/assert@1" + } +} diff --git a/main.ts b/main.ts new file mode 100644 index 0000000..292ce5f --- /dev/null +++ b/main.ts @@ -0,0 +1,8 @@ +export function add(a: number, b: number): number { + return a + b; +} + +// Learn more at https://docs.deno.com/runtime/manual/examples/module_metadata#concepts +if (import.meta.main) { + console.log("Add 2 + 3 =", add(2, 3)); +} diff --git a/main_test.ts b/main_test.ts new file mode 100644 index 0000000..3d981e9 --- /dev/null +++ b/main_test.ts @@ -0,0 +1,6 @@ +import { assertEquals } from "@std/assert"; +import { add } from "./main.ts"; + +Deno.test(function addTest() { + assertEquals(add(2, 3), 5); +});