1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-08-23 18:16:44 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/mechanisms/TestingMechanism.tid
Jermolene 2261fd4b84 Merge the dev material back into the main tw5.com wiki
It was getting a pain to manage the content in separate places, and I
suspect confusing for end users.

I think the best time to move the dev content out is when we’ve
established the community wiki for TW5, which is a much more natural
home for it.

In the meantime, a feature that I’m interested in exploring is the
ability to hide tiddlers from the UI based on tag. Then the tw5.com
wiki could disable all tiddlers tagged ‘dev’ until explicitly
overridden by the user.
2013-11-28 17:12:18 +00:00

37 lines
1.1 KiB
Plaintext

modified: 201311222159
tags: dev
title: TestingMechanism
TiddlyWiki5 incorporates the Jasmine JavaScript testing framework (see http://pivotal.github.io/jasmine/). It allows the same tests to be run both in the browser and under Node.js.
! TiddlyWiki5 Testing Components
There are two main elements to the TiddlyWiki5 testing mechanism:
* The plugin `tiddlywiki/jasmine` that wraps Jasmine up into a plugin along with some glue code
* The TiddlyWiki5 edition `test` that contains the core test specifications and includes the Jasmine plugin
! Running the Tests in Node.js
To run the tests under Node.js just load up the `test` wiki:
```
node ./tiddlywiki.js \
./editions/test \
```
! Running the Tests in the Browser
To generate a wiki containing the browser tests load up the `test` wiki and save it as an HTML file:
```
node ./tiddlywiki.js \
./editions/test \
--verbose \
--rendertiddler $:/core/save/all $TW5_BUILD_OUTPUT/test.html text/plain \
```
Then, open the `test.html` file in the browser to see the test results. There is a prebuilt version of `test.html` at:
http://five.tiddlywiki.com/test.html