Skip to content
This repository was archived by the owner on Aug 19, 2019. It is now read-only.

Commit 818bad2

Browse files
author
deepsweet
committed
🐣
0 parents  commit 818bad2

File tree

10 files changed

+178
-0
lines changed

10 files changed

+178
-0
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": [ "es2015" ],
3+
"plugins": [ "transform-runtime", "add-module-exports" ]
4+
}

.editorconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# http://editorconfig.org/
2+
root = true
3+
4+
[*]
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 4
11+
12+
[*.{json,yml}]
13+
indent_size = 2
14+
15+
[{.babelrc,.eslintrc}]
16+
indent_size = 2

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
tmp/

.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": [
3+
"rebem/configs/common",
4+
"rebem/configs/babel"
5+
]
6+
}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules/
2+
tmp/
3+
build/
4+
*.sublime-*
5+
*.log
6+
.DS_Store

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
sudo: false
2+
3+
language: node_js
4+
5+
# cache:
6+
# directories:
7+
# - node_modules
8+
9+
node_js:
10+
- "5"
11+
12+
branches:
13+
only:
14+
- master
15+
16+
script: npm run travis

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015–present Kir Belevich
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[![npm](https://img.shields.io/npm/v/start-karma.svg?style=flat-square)](https://www.npmjs.com/package/start-karma)
2+
[![travis](http://img.shields.io/travis/start-runner/karma.svg?style=flat-square)](https://travis-ci.org/start-runner/karma)
3+
[![deps](https://img.shields.io/gemnasium/start-runner/karma.svg?style=flat-square)](https://gemnasium.com/start-runner/karma)
4+
5+
[Karma](https://karma-runner.github.io/) task for [Start](https://github.com/start-runner/start).
6+
7+
## Install
8+
9+
```
10+
npm i -D start-karma
11+
```
12+
13+
## Usage
14+
15+
```js
16+
// tasks.js
17+
import start from 'start';
18+
import logger from 'start-simple-logger';
19+
import karma from 'start-karma';
20+
21+
export function test() {
22+
return start(logger())
23+
karma(require('karma.conf'))
24+
);
25+
}
26+
```
27+
28+
```js
29+
// package.json
30+
"scripts": {
31+
"task": "babel-node node_modules/.bin/start ./tasks",
32+
"test": "npm run task test"
33+
}
34+
```
35+
36+
## Arguments
37+
38+
`karma(config)`
39+
40+
* `config`[karma config](https://karma-runner.github.io/0.13/config/configuration-file.html)

lib/index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export default (config) => (input) => {
2+
return function karma(/* log */) {
3+
const { Server } = require('karma');
4+
5+
return new Promise((resolve, reject) => {
6+
const karmaServer = new Server(config, (exitCode) => {
7+
if (exitCode !== 0) {
8+
return reject();
9+
}
10+
11+
resolve(input);
12+
});
13+
14+
karmaServer.start();
15+
});
16+
};
17+
};

package.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"name": "start-karma",
3+
"version": "0.1.0",
4+
"description": "Karma task for Start",
5+
"keywords": [ "start", "start-task", "karma" ],
6+
"homepage": "https://github.com/start-runner/karma",
7+
"repository": "start-runner/karma",
8+
"author": "Kir Belevich <kir@soulshine.in> (https://github.com/deepsweet)",
9+
"files": [ "build/" ],
10+
"main": "build/index.js",
11+
"peerDependencies": {
12+
"start": "3.x.x"
13+
},
14+
"dependencies": {
15+
"karma": "0.x.x",
16+
"babel-runtime": "6.x.x"
17+
},
18+
"devDependencies": {
19+
"husky": "0.10.x",
20+
"rimraf": "2.5.x",
21+
22+
"babel-cli": "6.4.x",
23+
"babel-core": "6.4.x",
24+
"babel-preset-es2015": "6.3.x",
25+
"babel-plugin-transform-runtime": "6.4.x",
26+
"babel-plugin-add-module-exports": "0.1.x",
27+
28+
"eslint": "1.10.x",
29+
"babel-eslint": ">5.0.0-beta1",
30+
"eslint-plugin-babel": "3.0.x",
31+
"eslint-config-rebem": "0.3.x"
32+
},
33+
"scripts": {
34+
"prebuild": "rimraf build/",
35+
"build": "babel lib/ -d build/",
36+
"dev": "npm run build -- -w",
37+
38+
"lint": "eslint .",
39+
"test": "npm run lint",
40+
"travis": "npm test",
41+
42+
"prepush": "npm test",
43+
"prepublish": "npm run build"
44+
},
45+
"engines": {
46+
"node": ">=0.12.0",
47+
"npm": ">=2.7.0"
48+
},
49+
"license": "MIT"
50+
}

0 commit comments

Comments
 (0)