Jeff Williams 06acc6697a optionally scan tutorials directory recursively (#712)
Squashed commit of the following:

commit 5be2cb3103521d2ca1a14c24d4ccd776c1f2a5d9
Author: Jeff Williams <jeffrey.l.williams@gmail.com>
Date:   Mon Nov 3 14:29:29 2014 -0800

    make tutorials respect the --recurse option; refactor modules to facilitate testing; improve tests

commit 9af57751385439ceee3fac8f698a747a745c7c2b
Merge: 5399745 97a8ab0
Author: Jeff Williams <jeffrey.l.williams@gmail.com>
Date:   Sat Nov 1 19:00:43 2014 -0700

    Merge remote-tracking branch 'koalazak/master' into 712

    Conflicts:
    	lib/jsdoc/opts/args.js

commit 97a8ab000b567c220525cc179c2f45b626236933
Author: zak <zak@ultra>
Date:   Mon Jul 21 15:28:20 2014 -0300

    Removed command-line option -U to recursive. Now is default. Added tests.

commit a79c9c9dac4eeb784e3f22b1da073c2af5b014cc
Author: zak <zak@ultra>
Date:   Thu Jul 17 13:28:38 2014 -0300

    Recurse 5 levels

commit 349d10e528d6ba797fd745e31e1e358ddcf26857
Author: koalazak <facu@Cacahuate.local>
Date:   Wed Jul 16 22:30:41 2014 -0300

    Travis CI ready ready

commit ffde2bf4bdc2bd0ba2daa20a58540e4a2dd099e8
Author: koalazak <facu@Cacahuate.local>
Date:   Wed Jul 16 22:22:56 2014 -0300

    Travis CI ready

commit 3e439151fb58d530abe294f1cc499e5fab7b8fe8
Author: koalazak <facu@Cacahuate.local>
Date:   Wed Jul 16 21:47:22 2014 -0300

    Optionally scan tutorials directory recursively

    I do not want to have a directory of tutorials. I need to have the
    tutorials distributed throughout the project. I have one in each
    "package" folder.
2014-11-03 14:30:21 -08:00
..
2014-03-03 07:43:01 -08:00
2014-03-04 13:47:57 -08:00

Testing JSDoc 3

Running Tests

Running tests is easy. Just change your working directory to the jsdoc folder and run the following command on Windows:

jsdoc -T

Or on OS X, Linux, and other POSIX-compliant platforms:

./jsdoc -T

If you can't get the short-form commands to work, try invoking Java directly:

java -cp lib/js.jar org.mozilla.javascript.tools.shell.Main \
-modules node_modules -modules rhino -modules lib -modules . \
jsdoc.js -T

Writing Tests

Adding tests is pretty easy, too. You can write tests for JSDoc itself (to make sure tags and the parser, etc. are working properly), tests for plugins, and/or tests for templates.

JSDoc 3 uses Jasmine (https://github.com/pivotal/jasmine) as its testing framework. Take a look at that project's wiki for documentation on writing tests in general.

Tests for JSDoc

Take a look at the files in the test directory for many examples of writing tests for JSDoc itself. The test\fixtures directory hold fixtures for use in the tests, and the test\specs directory holds the tests themselves.

Tests for plugins

Tests for plugins are found in the plugins\test directory. Plugins containing tests that were installed with the Jakefile install task will be run automatically.

Tests for templates

TODO