Skip to content

Instantly share code, notes, and snippets.

View jkriss's full-sized avatar

Jesse Kriss jkriss

View GitHub Profile
@jkriss
jkriss / pre-commit
Last active September 29, 2022 03:53
pre-commit hook for deno fmt formatting
#!/bin/sh
FILES=$(deno fmt)
if [ -n "$FILES" ]; then
echo "formatted, adding files $FILES"
echo "$FILES" | xargs git add
fi
exit 0
@jkriss
jkriss / response.test.ts
Created July 15, 2020 03:01
deno response test
import {
assert,
assertEquals,
} from "https://deno.land/std/testing/asserts.ts";
// this passes
Deno.test("should be able to get text and body from a text response", async () => {
const res = new Response('hi')
assert(res.body)
assertEquals(await res.text(), 'hi')