Coder Social home page Coder Social logo

generator-karma's Introduction

Karma generator Build Status

See the Karma documentation for more info.

Why Karma?

Karma runs the tests in the browser, but reports them in the CLI. This greatly improves your workflow by giving you constant, accurate feedback on the status of your tests.

Usage

Install it globally npm install -g generator-karma.

Running yo karma will generate a config file for your project: karma.conf.js. It will then install the npm dependencies.

By default, running yo karma will generate a pretty boring (and almost useless) config file. The real power is using the options to specify almost every part of the config file.

Note that you'll need to update your Gruntfile.js if you don't specify the --gruntfile-path option.

Options

There are a lot of options going on here. None of them are required and most are probably only useful when used with other generators calling this one.

Options are specified after yo karma. Example:

yo karma --skip-install --frameworks=jasmine --app-files='app/**/*.js,public/**/*.js'

The full list:

  • --skip-install Type: Boolean, Default: false

Skips the automatic execution of npm after scaffolding has finished.

  • --coffee Type: Boolean, Default: false

Use CoffeeScript instead of JavaScript.

  • --frameworks Type: String, Default: 'jasmine'

Specifies which testing frameworks to use (CSV list). Example --frameworks=mocha,chai,requirejs,sinon

  • --browsers Type: String, Default: 'PhantomJS'

What browsers to test in (CSV list).

  • --app-files Type: String, Default: ''

List of application files (CSV list). There are purely the files you edit that make up your test.

  • --test-files Type: String, Default: ''

List of test files (CSV list), including spec and mock files.

  • --files-comments Type: String, Default: ''

List of comments to add to files properties. It can be used to support bower dependencies wiring using wiredep.

  • --exclude-files Type: String, Default: ''

List of files to exclude (CSV list). Files you don't want tested.

  • --plugins Type: String, Default: ''

Specify Karma plugins (npm modules). Use the full name like karma-junit-reporter.

  • --bower-components Type: String, Default: ''

Optional components to use for testing (CSV list of components).

  • --bower-components-path Type: String, Default: 'bower_components'

Directory where Bower components are installed, if not in the default location.

  • --travis Type: Boolean, Default: false

Enable Travis CI config generation by adding a .travis.yaml file.

  • --gruntfile-path Type: String, Default: ''

Path to a Gruntfile to edit. This is relative to your generators root directory. In other words, relative to this.destinationRoot() path.

  • --base-path Type: String, Default: ''

Will be used to resolve files and exclude in the karma.conf.js file.

  • --web-port Type: Number, Default: 8080

Web server port to run Karma from.

  • --template-path Type: String, Default: '../templates'

If you would like to specify a different template to use, give the path to that folder.

  • --config-file Type: String, Default: ''

The config file name to write to. Useful if you want a different name like karma-e2e.conf.js.

  • --config-path Type: String, Default: './test'

Path where the config files should be written to. This is where the karma.conf.js file will be placed.

Configuration

Karma can be configured by editing karma.conf.js. See the documentation page on the config file for an exhaustive list of options.

Contribute

See the contributing docs

License

BSD license

generator-karma's People

Contributors

addyosmani avatar alfonso-presa avatar arthurvr avatar artoale avatar btford avatar daftmonk avatar eddiemonge avatar elob avatar globegitter avatar guzart avatar hemanth avatar jonathanhaynes avatar kevva avatar mklabs avatar passy avatar safjanowski avatar sboudrias avatar seriema avatar sindresorhus avatar sleeper avatar toilal avatar tomwayson avatar vojtajina avatar x1011 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.