Testing & Linting
All testing-related documentation can be added here, and moved to a more appropriate location later if need be.
JavaScript unit testing
All new JavaScript should be covered by a test as part of our DOD going
forward. We're using Jasmine for
this, which is run via npm: $ npm test
Spec files are placed in /spec/
. The directory structure and
file naming within this directory should echo that of the JavaScript being
tested, with *.js
extensions being replaced with
*_spec.js
.
For example, /src/scripts/modules/jquery.pfAccordion.js
's
corresponding spec file is
/spec/modules/jquery.pfAccordion_spec.js
.
JavaScript linting
The JavaScript is run through ESLint,
and can be run via Grunt:
$ grunt eslint
. Finer configuration
of the linter rules can be made by tweaking the .eslintrc
and
.eslintignore
files.