Closed mapsam closed 9 years ago
Done! Our testing framework is in place with a good number of tests to get us going. Not complete, I'm sure, but I think at this point we start testing for bugs once they arise per @wpietri's suggestion yesterday.
Defiant
's XSL templates and instead uses our own quick scripts - the XSL were difficult to test and writing our own is just cleaner. Still using Defiant
for JSON.search()
functionality.validation
related scripts are located in front/js/validation
but have all of the configuration files, such as "what fields to validate" located in the appropriate template files (currently all within app/templates/patient_details.html
. Including the config in our JS didn't make sense from a testing perspective.app/templates/base.html
is our launch pad for JS scripts and functions. It's mostly checking for existing classes, such as .validation
before running - this ensures we aren't running unnecessary javascript on every page.tests/front/helpers.js
file includes a sketchy document.write()
series to recreate these as-is in the Phantom browser. If we change the HTML and JS workflow, it will likely break the test - I'm interested in hearing more efficient, less brittle ways of doing this!Once this is merged, you'll need to update node modules with npm install
. I've decided to not run tests every time watch
reloads because it can be a big bummer on workflow (adds extra time on reloads) so tests need to be run separately using:
gulp test
Onward!
Nice going @mapsam!
This PR adds front-end unit tests to the
./tests/front/
directory.Things to be tested:
main.js
maps.js
search.js
menu.js
DEFAULT_VALIDATORS
validation.js
function & prototypedatabinding.js
reporter.js
validation.config.js
filter.js
question_dependencies.js
This also incorporates all of the
validation.js
scripts by @bengolder in an old PR. Woop!