hoja - yet another simple, independent testing framework (TDD like)
Contents
WIP
-
Minimal testing framework designed with declarative syntax for test descriptions and an imperative syntax for execution flow.
-
The main motivation was the need to run specs on different / limited JavaScript engines such as rhino, V7,o ld browsers.
-
Supports synchronous text execution.:
- It's physically divided on two implementations, synchronous and asynchronous, on purpose since it was used on non asynchronous - non hackeable - JavaScript environments.
-
The assertion syntax is similar to jasmine / mocha based on
describe()
,expect()
,it()
.. -
But the execution flow is different, you explicitly stop / start groups of specs imperatively.
-
aims to be as portable, simple and fast.
-
basic support for reports but customizable. The objective is to be agnostics on the report output mediums so we limit to plain text.
-
for the server and the browser.
-
other scenario that shows to be useful is while bundling scripts to be runnel individually bu puppeteer os similar headless, in which case you need to be as fast as possible and a text report to stdout is enough.
Usage
npm install -D canto
API
- The flow is driven, imperatively, via the object
SpecRunner
. You declare your tests, and execute them using it:
resetdescribe'Fruit', // ... ahead in time...reset // make sure the next execution block is clean.describe'd1', // this time run() is configured and returns timing data.
run()
Returns a result object
TODO
- api docs
- fit(), fdescribe()
- make describes optional and introduce test() like ava / jest
- [w] easy framework to run the tests and descendt report with jsdom and puppetter.
- should we invest on optimize performance ?
- Issue : Reporter should be named "Renderer" and there should be another type "Reporter"
- async api