When looking at the Intern.io examples, I'm not following the path syntax.
For example:
define([
'intern!object',
'intern/chai!assert',
What's going on with the '!' character?
// Non-functional test suite(s) to run in each browser
suites: [ 'intern/node_modules/dojo/has!host-browser?tests/utils' ],
Can someone explain the path reference above for the suite path?
Thanks.
Module IDs with exclamation points are AMD loader plugins. The part before the exclamation point is the module ID of the loader plugin module, and the part after the exclamation point is plugin-specific information that the plugin module uses to decide what to do.
intern!object
loads theintern
plugin module and then tells it "object" (which causes the plugin to load the object interface API)intern/chai!assert
loads theintern/chai
plugin module (and tells it to load the assert-style API)intern/dojo/has!host-browser?tests/utils
(there should not be anode_modules
in this mid) loads thedojo/has
module from Intern’s internal copy of Dojo, and uses it to loadtests/utils
if thehost-browser
feature detection test is true (otherwise it loads nothing).