Skip to content

Commit 3a1d0df

Browse files
authored
Merge pull request #126 from gucong3000/coverage
Add coverage report
2 parents 2cb352f + 2748681 commit 3a1d0df

File tree

8 files changed

+145
-78
lines changed

8 files changed

+145
-78
lines changed

.eslintrc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
"SwitchCase": 1
2626
}
2727
],
28-
"comma-style": [
29-
2,
30-
"first"
31-
],
28+
"comma-style": 2,
3229
"max-len": [
3330
2,
3431
{

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
node_modules
22
npm-debug.log
33
.DS_Store
4+
.nyc_output/
5+
coverage/

.npmignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
*.log
2+
*.pid
3+
*.seed
4+
.editorconfig
5+
.eslintrc*
6+
.eslintignore
7+
.gitignore
8+
.grunt
9+
.lock-wscript
10+
.node_repl_history
11+
.stylelintrc*
12+
.travis.yml
13+
.vscode
14+
.nyc_output
15+
appveyor.yml
16+
coverage
17+
gulpfile.js
18+
lib-cov
19+
logs
20+
node_modules
21+
npm-debug.log*
22+
pids
23+
test
24+
test.js

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ node_js:
44
- stable
55
- 6
66
- 4
7+
after_success:
8+
- "npm run coveralls"

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# gulp-postcss [![Build Status](https://api.travis-ci.org/postcss/gulp-postcss.png)](https://travis-ci.org/postcss/gulp-postcss)
1+
# gulp-postcss
2+
3+
[![Build Status](https://img.shields.io/travis/postcss/gulp-postcss.png)](https://travis-ci.org/postcss/gulp-postcss)
4+
[![Coverage Status](https://img.shields.io/coveralls/postcss/gulp-postcss.png)](https://coveralls.io/r/postcss/gulp-postcss)
25

36
[PostCSS](https://github.com/postcss/postcss) gulp plugin to pipe CSS through
47
several plugins, but parse CSS only once.

index.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ module.exports = withConfigLoader(function (loadConfig) {
2525
: {}
2626

2727
var options = {
28-
from: file.path
29-
, to: file.path
28+
from: file.path,
29+
to: file.path,
3030
// Generate a separate source map for gulp-sourcemaps
31-
, map: file.sourceMap ? { annotation: false } : false
31+
map: file.sourceMap ? { annotation: false } : false
3232
}
3333

3434
loadConfig(file)
@@ -104,8 +104,8 @@ function withConfigLoader(cb) {
104104
if (Array.isArray(plugins)) {
105105
return cb(function () {
106106
return Promise.resolve({
107-
plugins: plugins
108-
, options: options
107+
plugins: plugins,
108+
options: options
109109
})
110110
})
111111
} else if (typeof plugins === 'function') {
@@ -127,8 +127,9 @@ function withConfigLoader(cb) {
127127
configPath = file.dirname
128128
}
129129
return postcssLoadConfig(
130-
{ file: file
131-
, options: contextOptions
130+
{
131+
file: file,
132+
options: contextOptions
132133
},
133134
configPath
134135
)

package.json

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
{
22
"name": "gulp-postcss",
3+
"nyc": {
4+
"lines": 100,
5+
"statements": 100,
6+
"functions": 100,
7+
"branches": 100,
8+
"reporter": [
9+
"lcov",
10+
"text"
11+
],
12+
"cache": true,
13+
"all": true,
14+
"check-coverage": true
15+
},
316
"version": "7.0.0",
417
"description": "PostCSS gulp plugin",
518
"main": "index.js",
619
"scripts": {
7-
"pretest": "eslint index.js",
8-
"test": "mocha test.js"
20+
"coveralls": "coveralls < coverage/lcov.info",
21+
"pretest": "eslint *.js",
22+
"test": "nyc mocha test.js"
923
},
1024
"repository": {
1125
"type": "git",
@@ -30,11 +44,12 @@
3044
"vinyl-sourcemaps-apply": "^0.2.1"
3145
},
3246
"devDependencies": {
33-
"eslint": "^3.19.0",
47+
"coveralls": "^2.13.1",
48+
"eslint": "^4.1.1",
3449
"gulp-sourcemaps": "^2.6.0",
35-
"mocha": "^3.3.0",
36-
"proxyquire": "^1.7.11",
37-
"sinon": "^2.2.0"
38-
},
39-
"files": []
50+
"mocha": "^3.4.2",
51+
"nyc": "^11.0.3",
52+
"proxyquire": "^1.8.0",
53+
"sinon": "^2.3.5"
54+
}
4055
}

0 commit comments

Comments
 (0)