Public
Test utility and status badge for Val Town
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

A test utility and badge to put in your val readme to show test suite status

Example:

Usage:

  1. Make a val
  2. Make a separate test suite HTTP file for the val you want to test
  3. Import describe and it utilities
  4. Write tests
  5. Add the badge to your readme, with the url parameter pointing to the test suite file's endpoint. Tests run whenever the test suite file or the badge is fetched
import { describe, it } from "https://esm.town/x/jxnblk/test/http.tsx"; import { assertEquals } from "jsr:@std/assert@1"; export default describe("my test suite", () => { const sum = (a, b) => a + b; it("sums it up", () => { assertEquals(sum(1, 2), 3); }) })

Badge:

[![][badge]][url] [badge]: https://testme.val.run?url=YOUR_TEST_SUITE_ENDPOINT [url]: YOUR_TEST_SUITE_URL

Example

[![][badge]][url] [badge]: https://testme.val.run?url=https://tuna-test.val.run [url]: https://www.val.town/x/jxnblk/test/code/example.http.tsx