包详细信息

karma-hydro

hydrojs19MIT0.2.0

Karma plugin - adapter for Hydro

karma-plugin, karma-adapter, hydro

自述文件

karma-hydro

Synopsis

Karma plugin for hydro.

Installation

npm install karma-hydro

Configuration

// karma.conf.js

module.exports = function(config) {
  config.set({
    frameworks: ['hydro'],

    files: [
      'test/*.js'
    ],

    hydro: {
      before: [
        'build/build.js' // files to be included before hydro
      ]
    },

    client: {
      hydro: {
        // hydro & hydro plugins options

        plugins: ['hydro-bdd' /* ... */],
        // ...

        // karma specific options

        setup: true // instantaneous setup, optional, default: false
      }
    }
  });
};

In most of the cases you might want to defer the hydro setup, because you want karma to include your plugins, prepare the environment manually or what have you.

Hydro will set itself up with karma, but it won't call the setup method so you can do it yourself later on.

Here is an example of how you can accomplish this:

// karma.conf.js

module.exports = function(config) {
  config.set({
    frameworks: [ 'hydro' ],

    files: [
      'hydro-bdd',
      'hydro-whatever',
      'hydro.karma.js', // this is where you could call `setup`
      'test/*.js'
    ],
  });
};
// hydro.karma.js

/* setup stuff, do whatever */

hydro.setup(); // here we setup hydro explicitly

License

The MIT License (see LICENSE)

更新日志

0.2.0 / 2014-01-26

  • Require hydro from dist

0.1.0 / 2014-01-21

  • Add option to include files before hydro

0.0.1 / 2013-12-21

  • Initial implementation