Our first tests
===============

As a reminder, here's our final implementation:

.. literalinclude:: /snippets/fizzbuzz.ts

Note that we `export` the `fizzbuzz` function, so we can import it later on.

Writing some tests
------------------

Writing a ``main`` and checking the output by hand is not fun, so let's write some tests instead:

.. literalinclude:: /snippets/fizzbuzz_test.ts


Running the tests
-----------------

.. code-block:: console

    $ deno test fizzbuzz_test.ts

    Check fizzbuzz_test.ts
    running 4 tests from ./fizzbuzz_test.ts
    Print 'fizz' when divisible by 3 ... ok
    Print 'buzz' when divisible by 5 ... ok
    Print 'fizzbuzz' when divisible by 15 ... ok
    Print number otherwise ... ok

    ok | 4 passed | 0 failed (4ms)
