https://github.com/riot/karma-riot
A Karma plugin. Compile and test HTML and JS in Riot tag files.
https://github.com/riot/karma-riot
karma riot
Last synced: 5 months ago
JSON representation
A Karma plugin. Compile and test HTML and JS in Riot tag files.
- Host: GitHub
- URL: https://github.com/riot/karma-riot
- Owner: riot
- License: mit
- Created: 2015-09-11T14:06:43.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-05-30T15:33:53.000Z (almost 6 years ago)
- Last Synced: 2024-04-24T19:32:26.901Z (12 months ago)
- Topics: karma, riot
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/karma-riot
- Size: 21.5 KB
- Stars: 19
- Watchers: 6
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/riot/karma-riot)
**Note:** if you are working with Riot.js 4 this plugin is no longer needed. Please check [this example](https://github.com/riot/examples/tree/gh-pages/timer) to see how Riot.js components can be tested directly in node.
# karma-riot
[karma-riot](https://github.com/riot/karma-riot) is a [Riot](https://riot.js.org) integration for [Karma](https://karma-runner.github.io) that handles tag modules with ease.
## Installation
Install `karma-riot` from npm:
```bash
$ npm install --save-dev karma-riot
```Your `package.json` will be like this:
```json
{
"devDependencies": {
"karma": "^1.3.0",
"karma-mocha": "1.3.0",
"karma-mocha-reporter": "^2.2.1",
"karma-phantomjs-launcher": "^1.0.2",
"karma-riot": "^2.0.0",
"riot": "^3.0.0"
}
}
```## Configuration
Following code shows the default configuration...
```js
// 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
```js
riotPreprocessor: {
options: {
type: 'es6'
}
}
```[Read the docs](http://riot.js.org/guide/compiler/#pre-processors) for more info on available options.
See [our example](./test/specs.js) for Mocha spec config.
----
For more information on Karma see the [homepage].
[homepage]: http://karma-runner.github.com