utiny

Allows unit testing of ES6 modules without additional dependencies right in your browser.

Usage no npm install needed!

<script type="module">
  import utiny from 'https://cdn.skypack.dev/utiny';
</script>

README

utiny

Tired of installing 25 dependencies, just to run unit tests? utiny is the essence of unit testing for JavaScript modules.

It allows unit testing of ES6 modules without additional dependencies, right in your browser.

Demo: http://shaack.com/projekte/utiny/test/

Works like this

  1. Create a test/index.html:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Tests</title>
</head>
<body>
<script type="module">
    import "./TestMyModule.js"
</script>
</body>
</html>
  1. Create the test module TestMyModule.js.
import {describe, it, assert} from "../src/utiny.js";

describe("utiny", () => {
    it("will not fail", () => {
        assert.true(2 * 2 === 4)
    })
    it("will fail", () => {
        assert.equals(4 + 2, 42)
    })
})