Skip to content

Instantly share code, notes, and snippets.

@nexpr
Last active December 18, 2023 13:45
Show Gist options
  • Save nexpr/3be830b7abc892ce0697f912bf94703b to your computer and use it in GitHub Desktop.
Save nexpr/3be830b7abc892ce0697f912bf94703b to your computer and use it in GitHub Desktop.
Deno で Gist のテストを動かす

Deno なら URL 指定で動かせるので Gist においたコードでテストを実行できて便利かも?と思って試すよう

  • テストが成功する場合
deno test https://gist.githubusercontent.com/nexpr/3be830b7abc892ce0697f912bf94703b/raw/5bcfd28dbdb428713502823c1241cbde3e2f6944/test.js
  • テストが失敗する場合
deno test https://gist.githubusercontent.com/nexpr/3be830b7abc892ce0697f912bf94703b/raw/64445a2c68f6c25494c9922aff704101ec8e2233/test.js
const add = (a, b) => a + b
export default add
import { assertEquals } from "https://deno.land/[email protected]/assert/mod.ts"
import add from "./add.js"
Deno.test("add", () => {
assertEquals(add(1, 2), 3)
assertEquals(add("foo", "bar"), "foobar")
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment