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

Configure Feed

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

create node-test

Kohei Watanabe (Aug 19, 2022, 11:19 PM +0900) 542bcbf4 4302d439

+31
+6
node-test/equal.test.js
··· 1 + import { test } from "node:test"; 2 + import assert from "node:assert/strict"; 3 + 4 + test("1 + 2 = 3", () => { 5 + assert.equal(1 + 2, 3); 6 + });
+1
node-test/hello.js
··· 1 + export default "hello!";
+7
node-test/hello.test.js
··· 1 + import { test } from "node:test"; 2 + import assert from "node:assert/strict"; 3 + import message from "./hello.js"; 4 + 5 + test("say hello", () => { 6 + assert.equal(message, "hello!"); 7 + });
+9
node-test/package.json
··· 1 + { 2 + "type": "module", 3 + "scripts": { 4 + "test": "node --test" 5 + }, 6 + "engines": { 7 + "node": "^18.7.0" 8 + } 9 + }
+8
node-test/parse-json.test.js
··· 1 + import { test } from "node:test"; 2 + import assert from "node:assert/strict"; 3 + 4 + test("parse json", () => { 5 + const json = `{"name": "太郎", "age": 42}`; 6 + const obj = JSON.parse(json); 7 + assert.deepEqual(obj, { name: "太郎", age: 42 }); 8 + });