From 46737d8f0f6342fa500fca1c3750d2dd5d7921e3 Mon Sep 17 00:00:00 2001 From: SimonFJ20 Date: Fri, 20 Sep 2024 00:43:24 +0200 Subject: [PATCH] add code --- deno.jsonc | 4 ++++ deno.lock | 21 +++++++++++++++++++++ main.ts | 4 +++- message.ts | 3 +++ message_test.ts | 6 ++++++ 5 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 deno.lock create mode 100644 message.ts create mode 100644 message_test.ts diff --git a/deno.jsonc b/deno.jsonc index 3fecf5f..5d3f868 100644 --- a/deno.jsonc +++ b/deno.jsonc @@ -1,5 +1,9 @@ { "fmt": { "indentWidth": 4 + }, + "tasks": { + "check": "deno check main.ts", + "test": "deno test" } } diff --git a/deno.lock b/deno.lock new file mode 100644 index 0000000..eb86aa2 --- /dev/null +++ b/deno.lock @@ -0,0 +1,21 @@ +{ + "version": "3", + "packages": { + "specifiers": { + "jsr:@std/assert": "jsr:@std/assert@1.0.5", + "jsr:@std/internal@^1.0.3": "jsr:@std/internal@1.0.3" + }, + "jsr": { + "@std/assert@1.0.5": { + "integrity": "e37da8e4033490ce613eec4ac1d78dba1faf5b02a3f6c573a28f15365b9b440f", + "dependencies": [ + "jsr:@std/internal@^1.0.3" + ] + }, + "@std/internal@1.0.3": { + "integrity": "208e9b94a3d5649bd880e9ca38b885ab7651ab5b5303a56ed25de4755fb7b11e" + } + } + }, + "remote": {} +} diff --git a/main.ts b/main.ts index 6b2b3db..473dac0 100644 --- a/main.ts +++ b/main.ts @@ -1 +1,3 @@ -console.log("hello world"); +import { message } from "./message.ts"; + +console.log(message()); diff --git a/message.ts b/message.ts new file mode 100644 index 0000000..74e12ab --- /dev/null +++ b/message.ts @@ -0,0 +1,3 @@ +export function message(): string { + return "hello world"; +} diff --git a/message_test.ts b/message_test.ts new file mode 100644 index 0000000..8f42fd2 --- /dev/null +++ b/message_test.ts @@ -0,0 +1,6 @@ +import { assertEquals } from "jsr:@std/assert"; +import { message } from "./message.ts"; + +Deno.test("message is correct", () => { + assertEquals(message(), "hello world"); +});