Setting Up Intern for Javascript Project -


i know there couple of similar questions answered (testing custom javascript (not node module) intern , can't intern run node.js module), after reading answers, i've still been unable simple tests run using intern. feel there 1 small piece overlooking or missing.

i trying evaluate intern use existing javascript project. it's not node project, plain javascript. if matters, trying perform evaluation on windows machine.

  1. my project hierarchy looks this:

    apefintern/     apeform/         test/             intern.js      - intern configuration             spec_inwf.js   - tests inwf         inwf.js            - code test     intern/ 
  2. intern configuration file:

    // ...  // configuration options module loader; amd configuration options supported dojo loader can // used here loader: {     // packages should registered loader in each testing environment     //packages: [ 'apeform' ] },  // non-functional test suite(s) run in each browser suites: [ 'apeform/test/spec_inwf' ],  // ... 

    i'm pretty new node , amd, believe since project not node project, not need use loader.packages configuration?

  3. test file spec_inwf.js

    define([ 'intern!bdd', 'intern!chai!expect', 'apeform/inwf.js' ], function (bdd, expect) {     (bdd) {         describe("inwf suite", function () {             // tests         });     } }); 
  4. i execute following command try , run tests:

    node client.js config=apeform/test/intern 

    the output receive command is:

    defaulting "console" reporter 

if set suites array empty in intern configuration, message "0/0 tests passed" when execute command in #4. believe correct output. whenever try connect test suite, tests aren't run. i'm not sure else i'm missing equation. appreciated.

it looks have small syntax issue in spec_inwf.js test file:

'intern!chai!expect', 

should be

'intern/chai!expect', 

everything else looks fine setup.

note: statement not needing use loader.packages config if project isn't node project not accurate. don't need use in particular case file structure provided, however. the amdjs packages documentation may worth read better understanding of configuration option, amd-specific, not intern specific. hope helps.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -