I have been developing an application using the ArcGIS Javascript API and incorporating tests with Intern. While working on Windows 7 under IIS, I encountered some challenges but managed to overcome them by following the Intern tutorial and referring to solutions like altering loaders for Intern. By setting the loader in client.html to
<script src="http://js.arcgis.com/3.7/"></script>
, I was able to run my tests successfully after adjusting paths in both the query string and intern.js to include the parent path defined in IIS.
For instance, assuming my app is hosted at http://localhost/testApp/mySite
with folders such as js, css, tests, and node_modules within it, running tests would require altering the path to something like
http://localhost/testApps/mySite/node_modules/intern/client.html?config=mySite/tests/intern
by adding mySite
to the config location. Similarly, suites had to be defined accordingly in my configuration:
suites: [
'mySite/tests/suite1',
'mySite/tests/suite2',
'mySite/tests/suite3'
],
If sticking to the default loader script tag without changing to a different loader in client.html, which uses the version of Dojo from node_modules, no additional path modification is needed (although the esri library might not be found).
In addition, I came across the esri jsapi version of the Intern tutorial, where loader changes were not required. The difference lies in utilizing intern-geezer instead of the regular Intern due to compatibility issues with Dojo 1.8.3. However, since I am using esri jsapi 3.7 with Dojo 1.9.1 and do not need support for older IE versions, I prefer avoiding geezer if possible. Despite specifying packages in intern.js similarly to the tutorial, one test did not pass, probably due to chai discrepancies between regular Intern and geezer. Nonetheless, utilizing intern-geezer did not necessitate any path modifications, unlike with Intern.
Is there a way to make Intern work with esri jsapi without modifying the loader in client.html? It would be ideal to have automated command line execution for these tests as well.