1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-27 10:30:28 +00:00
TiddlyWiki5/plugins/tiddlywiki/jasmine/readme.tid

36 lines
1.2 KiB
Plaintext
Raw Normal View History

title: $:/plugins/tiddlywiki/jasmine/readme
2022-11-20 17:54:18 +00:00
This plugin provides a framework for running tests in the browser and under Node.js. It is based on [[Jasmine|https://jasmine.github.io/]] test framework. On Tiddlywiki, it runs tests in all javascript tiddlers tagged with <<tag $:/tags/test-spec>>.
[[Source code|https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/jasmine]]
2022-11-20 17:54:18 +00:00
!! Usage on Node.js
On the command line, type `tiddlywiki --test`.
Alternatively, you can set up a build task for jasmine by including the following in your tiddlywiki.info file:
```
{
...
"build": {
...
"test": ["--test"]
}
}
```
You could then run tests by typing `tiddlywiki --build test` or just `tiddlywiki --build`. The advantage to this is it allows you to include other commands to run as well. See `tiddlywiki --help test` for more information.
This will run the tests and produce a test file in your output directory.
```
"test": [
"--test",
"--rendertiddler","$:/core/save/all","test.html","text/plain"]
```
!! Usage on a browser
Once you've constructed a Tiddlywiki file using a command like the one above, you can run the tests simply by opening it. Tests run automatically, and the results will be at the bottom of the window.