Skip to content

Instantly share code, notes, and snippets.

@kristoferjoseph
Last active May 4, 2022 19:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kristoferjoseph/89373269912b9c710b3157ab49ae8a76 to your computer and use it in GitHub Desktop.
Save kristoferjoseph/89373269912b9c710b3157ab49ae8a76 to your computer and use it in GitHub Desktop.
deno file watcher test runner
import { exec } from "https://deno.land/x/exec/mod.ts";
const watcher = Deno.watchFs("./");
for await (const event of watcher) {
// if you're curious
// let kind = event.kind
// console.log('EVENT KIND: ', kind)
await exec('clear')
await exec('deno test --allow-read')
}
@kristoferjoseph
Copy link
Author

run with:
deno run --allow-run --allow-read watch.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment