generator-karma-esri

0.0.1 • Public • Published

generator-karma-esri Build Status

A Yeoman generator to configure Karma to run unit tests to your ArcGIS API for JavaScript application

See my tutorial for more on running unit tests with Karma in ArcGIS API for JavaScript apps.

Getting Started

Install [Yeoman] (if you haven't already)

npm install -g yo

To install generator-karma-esri from npm, run:

npm install -g generator-karma-esri

Finally, initiate the generator:

yo karma-esri

Answer the man's questions. When in doubt, you'll probably be safe with the defaults.

Running Tests with Karma

After running the generator you'll want to tell Karma where your source code and test spec files can be found. Open karma.config.js and update the files section with the paths where those files can be found. Be sure to set included:false since these will be loaded by Dojo's AMD loader. For example:

    // list of files / patterns to load in the browser
    files: [
      // karma and dojo config
      'test/config.js',
      // source code
      { pattern: 'app/**/*.js', included:false },
      // test specs
      { pattern: 'test/spec/**/*.js', included:false }
    ],

After that you can run Karma with:

karma start

See my tutorial for more on running unit tests with Karma in ArcGIS API for JavaScript apps.

License

Apache

/generator-karma-esri/

    Package Sidebar

    Install

    npm i generator-karma-esri

    Weekly Downloads

    1

    Version

    0.0.1

    License

    Apache-2.0

    Last publish

    Collaborators

    • tomwayson