Skip to content

Instantly share code, notes, and snippets.

@benchristel
Created July 3, 2022 18:34
Show Gist options
  • Save benchristel/9e9f4d53edbe0f2f33725669e4405de0 to your computer and use it in GitHub Desktop.
Save benchristel/9e9f4d53edbe0f2f33725669e4405de0 to your computer and use it in GitHub Desktop.
Using taste in codepen.io
<div id="results"/>
import {createSuite, expect, is, runTests, formatTestResultsAsText} from "https://cdn.skypack.dev/@benchristel/taste@0.3.1";
const {test, getAllTests} = createSuite()
test("math", {
"adds"() {
expect(1 + 1, is, 2)
}
})
const results = await runTests(getAllTests())
document.getElementById("results").innerText = formatTestResultsAsText(results)
#results {
white-space: pre-wrap;
font-family: monospace;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment