Confirmed users
162
edits
mNo edit summary |
|||
| Line 25: | Line 25: | ||
You should place your test files in <tt>''yourmoduledir''/test/unit</tt>. There are actually three types of files that can be put there: | You should place your test files in <tt>''yourmoduledir''/test/unit</tt>. There are actually three types of files that can be put there: | ||
* <tt>head_*.js</tt> - arbitrary JS code that gets executed before the tests are run. | * <tt>head_*.js</tt> - arbitrary JS code that gets executed before the tests are run. | ||
* <tt>test_*.js</tt> - the | * <tt>test_*.js</tt> - the unit tests themselves. | ||
* <tt>tail_*.js</tt> - arbitrary JS code that gets executed after the actual tests are run. | * <tt>tail_*.js</tt> - arbitrary JS code that gets executed after the actual tests are run. | ||
| Line 35: | Line 35: | ||
The unit tests can be run using <tt>make check</tt> or using <tt>test_all.sh</tt> directly: | The unit tests can be run using <tt>make check</tt> or using <tt>test_all.sh</tt> directly: | ||
* To use <tt>make check</tt>, <tt>cd</tt> to an appropriate directory (e.g. to run tests for a single module, go to <tt>''modulepath''/test</tt>) and run <tt>make check</tt>. | * To use <tt>make check</tt>, <tt>cd</tt> to an appropriate directory (e.g. to run tests for a single module, go to <tt>''modulepath''/test</tt>) and run <tt>make check</tt>. | ||
* When using <tt>test_all.sh</tt>, either <tt>cd</tt> to the folder with unit test files and run <tt>test_all.sh</tt> or run it from <tt>dist/bin</tt> with the directory containing the unit test files as a parameter, e.g.<pre>bash test_all.sh test_mymodule</pre> | * When using <tt>test_all.sh</tt>, either <tt>cd</tt> to the folder with unit test files and run <tt>test_all.sh</tt> or run it from <tt>dist/bin</tt> with the directory containing the unit test files as a parameter, e.g.: <pre>bash test_all.sh test_mymodule</pre> | ||