webxl / karma-riot

A Karma plugin. Compile and test HTML and JS in Riot tag files.

Home Page:https://www.npmjs.com/package/karma-riot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

karma-riot

karma-riot is a Riot integration for Karma that handles tag modules with ease.

Installation

Install karma-riot from npm:

$ npm install --save-dev karma-riot

Your package.json will be like this:

{
  "devDependencies": {
    "karma": "^0.13.9",
    "karma-mocha": "^0.2.0",
    "karma-mocha-reporter": "^1.1.1",
    "karma-phantomjs-launcher": "^0.2.1",
    "karma-riot": "^1.0.1",
    "riot": "^2.3.1"
  }
}

Configuration

Following code shows the default configuration...

// karma.conf.js
module.exports = function(config) {
  config.set({
    frameworks: ['mocha', 'riot'],
    plugins: [
      'karma-mocha',
      'karma-mocha-reporter',
      'karma-phantomjs-launcher',
      'karma-riot'
    ],
    files: [
      '**/*.tag',
      'test/**/*.js'
    ],
    preprocessors: {
      '**/*.tag': ['riot']
    },
    browsers: ['PhantomJS'],
    reporters: ['mocha']
  })
}

Options

riotPreprocessor: {
  options: {
    type: 'es6'
  }
}

Read the docs for more info on available options.

See our example for Mocha spec config.


For more information on Karma see the homepage.

About

A Karma plugin. Compile and test HTML and JS in Riot tag files.

https://www.npmjs.com/package/karma-riot

License:MIT License


Languages

Language:JavaScript 100.0%