UNPKG

@jsenv/cli

Version:

Command Line Interface for jsenv

33 lines (28 loc) 729 B
<!-- This HTML file demo how to write a test using jsenv. This file is testing a "countDogs" function implemented in "animals.js" --> <!doctype html> <html> <head> <meta charset="utf-8" /> <link rel="icon" href="data:," /> </head> <body> <script type="module"> import { assert } from "@jsenv/assert"; import "../app/animals.js"; { const actual = window.countDogs(["dog", "dog"]); const expect = 2; assert({ actual, expect }); } { const actual = window.countDogs(["dog", "cat"]); const expect = 1; assert({ actual, expect }); } document.body.appendChild(document.createTextNode("ok")); </script> </body> </html>