javascript - Intern path error in browser client -


i have conventional recommended intern directory structure:

myproject ├── node_modules │ ├── intern-geezer │ │ ├── client.html ├── src │ ├── myfunction.js ├── tests │ ├── intern.js │ ├── unit │ │ ├── ps.js

with simple config:

useloader: {     'host-node': 'dojo/dojo',     'host-browser': 'node_modules/dojo/dojo.js' },  loader: {     packages: [] },  suites: [ 'tests/unit/ps' ] 

and tests:

define(function (require) {     var tdd = require('intern!tdd');      var assert = require('intern/chai!assert');       // global function test, not amd module     var parsef = require('src/myfunction.js');      var = require('tests/he');      tdd.suite('my tests', function() {        //etc    }); }); 

````

but when open browser client loader looking test suite inside intern-geezer directory:

enter image description here

i not setting baseurl in config (or in browser url). didn't have trouble going through regular (non-geezer) intern tutorial. since baseurl defaults 2 directories client.html don't see i'm doing wrong. help. (yes, need geezer ancient ie. no, not want rewrite function i'm testing amd module.)

the intern loader doesn't know how tests because haven't been registered package. when using recommended directory structure, you'll want set recommended loader configuration intern knows find code , tests.

  loader: {     packages: [       { name: 'app', location: 'src/' },       { name: 'tests', location: 'tests/' }     ]   } 

then, update tests correctly find code need test.

    // global function test, not amd module     var parsef = require('app/myfunction.js'); 

now, intern should able correctly find code , tests.


Comments

Popular posts from this blog

How to run C# code using mono without Xamarin in Android? -

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -