A Squirrel Testing Framework
It's all in
documentation-spec.nut. There you will find the ported version of the Jasmine Documentation. That file also doubles as the test suite of SqJasmine.
Local development works like a charm, for example this will run the self-testing suite on a Mac:
$ brew install squirrel /.../ $ sq documentation-spec.nut A suite contains spec with one or more expectations A failing suite contains spec with a failing expectation A suite is just a function and so is a spec The 'toBe' matcher compares and has a positive case and can have a negative case Included matchers: The 'toBe' matcher compares with == The 'toEqual' matcher works for simple literals and variables works for negative testing simple literals and variables can fail for simple literals and variables can fail for negatively tested simple literals and variables handles tables: can be empty requires tables to be of the same sizes needs to contain the same data needs to contain the same keys can be negated: can detect different values of the same slot can detect different number of slots can detect same number of slots but with different keys can contain more simple data can contain nested tables can be equal can negatively test nested tables can fail for nested tables A spec is just a function, so it can contain any code can have more than one expectation
Automatically running the tests on source code file save is an incredible productivity boost. Here's how it can be done using entr on a Mac:
$ brew install entr $ find . -name '*.nut' | entr -c bash -c 'sq helper-specs.nut && sq documentation-specs.nut'