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

Commit e296684

Browse files
author
deepsweet
committed
🐣
0 parents  commit e296684

File tree

13 files changed

+3643
-0
lines changed

13 files changed

+3643
-0
lines changed

.appveyor.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# https://www.appveyor.com/docs/appveyor-yml
2+
3+
version: "{build}"
4+
init:
5+
- git config --global core.autocrlf false
6+
shallow_clone: true
7+
environment:
8+
matrix:
9+
- nodejs_version: "4"
10+
- nodejs_version: "6"
11+
- nodejs_version: "7"
12+
cache:
13+
- "%LOCALAPPDATA%\\Yarn"
14+
branches:
15+
only:
16+
- master
17+
- /^greenkeeper\/.*$/
18+
skip_tags: true
19+
matrix:
20+
fast_finish: true
21+
build: off
22+
install:
23+
- ps: Install-Product node $env:nodejs_version
24+
- yarn
25+
test_script:
26+
- yarn start ci

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": [ "start" ]
3+
}

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.eslintrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": [
3+
"tough/config/common",
4+
"tough/config/node",
5+
"tough/config/esnext"
6+
],
7+
"rules": {
8+
"no-magic-numbers": 0,
9+
"promise/always-return": 0
10+
}
11+
}

.gitignore

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

.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# https://docs.travis-ci.com/user/customizing-the-build/
2+
3+
sudo: false
4+
language: node_js
5+
node_js:
6+
- "4"
7+
- "6"
8+
- "7"
9+
cache: yarn
10+
branches:
11+
only:
12+
- master
13+
- /^greenkeeper\/.*$/
14+
matrix:
15+
fast_finish: true
16+
script: yarn start ci

lib/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
export default (userOptions = {}) => () => {
2+
return function jest() {
3+
const jestCLI = require('jest-cli');
4+
const options = { config: userOptions };
5+
6+
return new Promise((resolve, reject) => {
7+
jestCLI.runCLI(options, process.cwd(), (result) => {
8+
if (
9+
result.numFailedTests > 0 ||
10+
result.numFailedTestSuites > 0 ||
11+
result.numTotalTests === 0
12+
) {
13+
return reject();
14+
}
15+
16+
resolve();
17+
});
18+
});
19+
};
20+
};

license.md

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) 2016–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.

package.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "start-jest",
3+
"version": "0.1.0",
4+
"description": "Jest task for Start",
5+
"keywords": [
6+
"start",
7+
"start-task",
8+
"jest"
9+
],
10+
"homepage": "https://github.com/start-runner/jest",
11+
"repository": "start-runner/jest",
12+
"author": "Kir Belevich <[email protected]> (https://github.com/deepsweet)",
13+
"files": [
14+
"build/"
15+
],
16+
"main": "build/index.js",
17+
"dependencies": {
18+
"jest-cli": "^19.0.2"
19+
},
20+
"devDependencies": {
21+
"babel-preset-start": "^0.1.0",
22+
"eslint-config-tough": "^0.4.0",
23+
"husky": "^0.13.1",
24+
"sinon": "^1.17.5",
25+
"start-babel-cli": "^4.0.1",
26+
"start-start-preset": "^3.0.0",
27+
"tape": "^4.6.0"
28+
},
29+
"scripts": {
30+
"start": "start-runner -p start-start-preset",
31+
"prepush": "yarn start prepush",
32+
"prepublish": "yarn start build"
33+
},
34+
"engines": {
35+
"node": ">=4"
36+
},
37+
"license": "MIT"
38+
}

readme.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# start-jest
2+
3+
[![npm](https://img.shields.io/npm/v/start-jest.svg?style=flat-square)](https://www.npmjs.com/package/start-jest)
4+
[![linux build](https://img.shields.io/travis/start-runner/jest/master.svg?label=linux&style=flat-square)](https://travis-ci.org/start-runner/jest)
5+
[![windows build](https://img.shields.io/appveyor/ci/start-runner/jest/master.svg?label=windows&style=flat-square)](https://ci.appveyor.com/project/start-runner/jest)
6+
[![coverage](https://img.shields.io/codecov/c/github/start-runner/jest/master.svg?style=flat-square)](https://codecov.io/github/start-runner/jest)
7+
[![deps](https://img.shields.io/gemnasium/start-runner/jest.svg?style=flat-square)](https://gemnasium.com/start-runner/jest)
8+
9+
[Jest](https://facebook.github.io/jest/) task for [Start](https://github.com/start-runner/start).
10+
11+
## Install
12+
13+
```sh
14+
npm install --save-dev start-jest
15+
# or
16+
yarn add --dev start-jest
17+
```
18+
19+
## Usage
20+
21+
```js
22+
import start from 'start';
23+
import reporter from 'start-pretty-reporter';
24+
import env from 'start-env';
25+
import jest from 'start-jest';
26+
27+
export const build= () => start(reporter())(
28+
env('NODE_ENV', 'test'),
29+
jest({
30+
config: {
31+
moduleNameMapper: {
32+
'^~/(.*)$': '<rootDir>/packages/$1'
33+
},
34+
roots: [
35+
'<rootDir>/packages/neoform/'
36+
],
37+
testMatch: [
38+
'**/tests/*.jsx'
39+
],
40+
collectCoverage: true,
41+
collectCoverageFrom: [
42+
'**/src/*.jsx'
43+
],
44+
coverageReporters: [
45+
'lcov',
46+
'text-summary'
47+
],
48+
snapshotSerializers: [
49+
'enzyme-to-json/serializer'
50+
]
51+
}
52+
})
53+
);
54+
```
55+
56+
## Arguments
57+
58+
`jest(options)`
59+
60+
* `options`[Jest options](https://facebook.github.io/jest/docs/configuration.html#content)

0 commit comments

Comments
 (0)