This happens when you install jsdoc via homebrew on Mac OS X. The jsdoc binary is actually a link to "../Cellar/jsdoc3/3.2.0/bin/jsdoc", which without this patch the BASEPATH line below tries to cd up a level from the current working directory and into a non-existent Cellar directory.
Under Cygwin, we need to be a bit more aggressive with replacing \ with /
to avoid \ in URIs internally. This shows up when running the tests with -T,
but not when running files directly, for reasons I don't fully understand.
This patch replaces the previous replacement of \ => / with one that happens
earlier and applies to all references, not just the URIs we construct.
Cygwin now passes jsdoc -T from any directory.
On MinGW and Cygwin, we have different representations for pathnames,
neither of which Rhino understands. We also have to contend with '\',
which is not a legal URI character.
And we have to supply a third / after file:// (two before the null
hostname, and one before the start of the absolute path). Since Windows
paths don't start with /, we have to supply it in that case.
We handle the MinGW and Cygwin cases by asking for the information with
'pwd -W' for MinGW and 'cygpath $(pwd)' for Cygwin, before finally
falling back to pwd for everyone else. Then, if they don't start with '/'
we supply the extra '/' for the URL.
This first part of the testing framework upgrade:
- enhances the jsdoc script to allow switching to debug mode from the command line
- uses Jasmine to run tests
- adds flexibility to run tests from multiple root directories
- does automatic test discovery, so test files can just be created, dropped in an appropriate folder, and run without having to explicity add it to the test runner
- cleans up the test directory layout
- incorporates env.rhino.js which should make it easier to test templates
- is incomplete: this is just a savepoint. About 1/3 of the tests have been converted. The rest are still run through the old testrunner