Public
HTTP (deprecated)
  • jxnblk avatar
    test
    @jxnblk
    A test utility and badge to put in your val readme to show test suite status Example: Usage: Make a val Make a separate test suite HTTP val for the val you want to test Import describe and it utilities Write tests Add the badge to your readme, with the url parameter pointing to the test suite val's endpoint. Tests run whenever the test suite val or the badge is fetched import { describe, it } from "https://esm.town/v/jxnblk/test"; 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://jxnblk-test.web.val.run?url=YOUR_TEST_SUITE_ENDPOINT [url]: YOUR_TEST_SUITE_URL Example [![][badge]][url] [badge]: https://jxnblk-test.web.val.run?url=https://jxnblk-tunatestsuite.web.val.run [url]: https://www.val.town/v/jxnblk/tunaTestSuite
    HTTP (deprecated)
  • jxnblk avatar
    tuna
    @jxnblk
    🐟 Simple CSS library for Val Town import { css } from "https://esm.town/v/jxnblk/tuna"; const styles = css({ body: { // special keyword for <body> element fontFamily: "system-ui, sans-serif", margin: 0, backgroundColor: "#f5f5f5", }, container: { padding: 32, // numbers are converted to pixel units margin: "0 auto", maxWidth: 1024, }, input: { fontFamily: "inherit", fontSize: "inherit", lineHeight: "1.5", padding: "2px 8px", border: "1px solid #ccc", borderRadius: "4px", }, }); // JSX example const html = render( <div className={styles.container}> <style {...styles.tag} /> <h1>Tuna Example</h1> <input type="text" defaultValue="hi" className={styles.input} /> </div> ); // get raw CSS string styles.css Nested selectors and pseudoselectors const styles = css({ button: { background-color: "tomato", "&:hover": { background-color: "magenta", }, "& > svg": { fill: "currentColor", }, }, }); Media queries const styles = css({ box: { padding: 16, "@media screen and (min-width: 768px)": { padding: 32, "&:hover": { color: "tomato", }, }, } }); Limitations Does not support HTML element selectors (other than body ) Tests: https://www.val.town/v/jxnblk/tuna_tests
    Script
1
Next
jxnblk-tunatestsuite.web.val.run
August 2, 2024