Skip to content

Commit 9c1c57c

Browse files
committed
feat: deno init
1 parent 0492dc8 commit 9c1c57c

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

deno.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"tasks": {
3+
"dev": "deno run --watch main.ts"
4+
},
5+
"imports": {
6+
"@std/assert": "jsr:@std/assert@1"
7+
}
8+
}

deno.lock

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

main.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export function add(a: number, b: number): number {
2+
return a + b;
3+
}
4+
5+
// Learn more at https://docs.deno.com/runtime/manual/examples/module_metadata#concepts
6+
if (import.meta.main) {
7+
console.log("Add 2 + 3 =", add(2, 3));
8+
}

main_test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { assertEquals } from "@std/assert";
2+
import { add } from "./main.ts";
3+
4+
Deno.test(function addTest() {
5+
assertEquals(add(2, 3), 5);
6+
});

0 commit comments

Comments
 (0)