This commit is contained in:
Will 2025-02-03 17:09:48 -05:00
commit 6de2f55370
3 changed files with 22 additions and 0 deletions

8
deno.json Normal file
View File

@ -0,0 +1,8 @@
{
"tasks": {
"dev": "deno run --watch main.ts"
},
"imports": {
"@std/assert": "jsr:@std/assert@1"
}
}

8
main.ts Normal file
View File

@ -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));
}

6
main_test.ts Normal file
View File

@ -0,0 +1,6 @@
import { assertEquals } from "@std/assert";
import { add } from "./main.ts";
Deno.test(function addTest() {
assertEquals(add(2, 3), 5);
});