1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-26 18:10:27 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/mechanisms/TestingMechanism.tid

37 lines
1.1 KiB
Plaintext
Raw Normal View History

modified: 201311222159
2014-05-03 15:27:22 +00:00
tags: dev mechanism
2013-04-25 17:01:48 +00:00
title: TestingMechanism
2013-04-25 16:55:59 +00:00
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.
2013-04-25 16:55:59 +00:00
! TiddlyWiki5 Testing Components
There are two main elements to the TiddlyWiki5 testing mechanism:
2013-04-25 17:01:48 +00:00
2013-04-25 16:55:59 +00:00
* 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
2013-04-25 16:55:59 +00:00
To run the tests under Node.js just load up the `test` wiki:
2013-04-25 16:55:59 +00:00
```
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 \
2013-04-25 16:55:59 +00:00
```
Then, open the `test.html` file in the browser to see the test results. There is a prebuilt version of `test.html` at:
http://tiddlywiki.com/test.html