Skip to content

Yeoman generator to add the Karma test runner to an Esri ArcGIS for JavaScript API app

License

Notifications You must be signed in to change notification settings

tomwayson/generator-karma-esri

Repository files navigation

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

About

Yeoman generator to add the Karma test runner to an Esri ArcGIS for JavaScript API app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published