プレイグラウンド、サンドボックス、使い捨てスクリプト置き場
0

Configure Feed

Select the types of activity you want to include in your feed.

deno lint, deno test

Kohei Watanabe (Nov 26, 2021, 12:10 PM +0900) 998590ba 58d3e74c

+29 -4
+9
deno/add.test.ts
··· 1 + import { assertStrictEquals } from "testing/asserts.ts"; 2 + import { add } from "./add.ts"; 3 + 4 + Deno.test({ 5 + name: "add", 6 + fn() { 7 + assertStrictEquals(add(1, 2), 3); 8 + }, 9 + });
+1
deno/add.ts
··· 1 + export const add = (a: number, b: number) => a + b;
+1 -1
deno/app.ts
··· 1 - import { Handler, ServeInit, serve } from "http/server.ts"; 1 + import { Handler, serve, ServeInit } from "http/server.ts"; 2 2 3 3 const handler: Handler = () => new Response("Hello World\n"); 4 4 const options: ServeInit = { addr: "localhost:8080" };
+8
deno/deno.json
··· 1 + { 2 + "$schema": "https://raw.githubusercontent.com/denoland/deno/main/cli/schemas/config-file.v1.json", 3 + "lint": { 4 + "rules": { 5 + "include": ["default-param-last", "eqeqeq"] 6 + } 7 + } 8 + }
+2 -1
deno/importmap.json
··· 1 1 { 2 2 "imports": { 3 - "http/": "https://deno.land/std@0.115.1/http/" 3 + "http/": "https://deno.land/std@0.115.1/http/", 4 + "testing/": "https://deno.land/std@0.116.0/testing/" 4 5 } 5 6 }
+8 -2
deno/scripts.yml
··· 1 1 # yaml-language-server: $schema=https://deno.land/x/denon@2.4.10/schema.json 2 - importmap: importmap.json 2 + 3 3 scripts: 4 4 start: 5 - cmd: "deno run app.ts" 5 + cmd: "deno run --import-map=importmap.json app.ts" 6 6 allow: [net] 7 + test: 8 + cmd: "deno test --import-map=importmap.json" 9 + lint: 10 + cmd: "deno lint --config=deno.json ." 11 + fmt: 12 + cmd: "deno fmt --config=deno.json ."