An open API service indexing awesome lists of open source software.

https://github.com/guiltydolphin/dentest

Testing framework for Deno
https://github.com/guiltydolphin/dentest

Last synced: over 1 year ago
JSON representation

Testing framework for Deno

Awesome Lists containing this project

README

          

#+TITLE: Dentest

Testing framework for Deno.

* Usage

Dentest provides support for grouping tests using
=testGroup=. Only top-level tests need to be run using the
=runAsMain= method. The following example shows how to group
tests in this manner:

#+BEGIN_SRC typescript
import {
assertEquals,
testGroup,
Test
} from 'https://deno.land/x/dentest/mod.ts'

testGroup('booleans',
new Test('true is true', () => assertEquals(true, true)),
new Test('false is false', () => assertEquals(false, false)),
testGroup('more boolean tests',
new Test('not true is false', () => assertEquals(!true, false)),
new Test('not false is true', () => assertEquals(!false, true)),
),
).runAsMain();
#+END_SRC

* Development

** Coverage

To generate code test coverage, make sure you have access to
the =genhtml= tool (e.g., via the [[https://aur.archlinux.org/packages/lcov/][lcov package on AUR]]), then
run =make coverage= in the top-level of the project.

** Testing

Run =make test= in the top-level of the project to run the
tests. If you need to see results for tests that passed, run
=make test_verbose= or =deno test= instead.