Skip to content

Commit

Permalink
Merge pull request postcss#13 from gucong3000/testcase_script
Browse files Browse the repository at this point in the history
fix pretest script & nyc config
  • Loading branch information
JosefJezek committed Jul 6, 2017
2 parents 89c23cc + 4650dfe commit fe18e28
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
2 changes: 1 addition & 1 deletion lib/applySourceMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const applySourceMap = require('vinyl-sourcemaps-apply');
const path = require('path');

module.exports = function(file, result) {
// Apply source map to the chain
// Apply source map to the chain
if (file.sourceMap) {
const map = result.map.toJSON();
map.file = file.relative;
Expand Down
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
"statements": 100,
"functions": 100,
"branches": 100,
"include": [
"lib/**/*.js"
],
"reporter": [
"lcov",
"text"
Expand All @@ -21,7 +18,7 @@
"main": "lib/index.js",
"scripts": {
"coveralls": "coveralls < coverage/lcov.info",
"pretest": "eslint index.js",
"pretest": "eslint lib test",
"test": "nyc mocha"
},
"repository": {
Expand Down
24 changes: 12 additions & 12 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ it('should pass file when it isNull()', function (cb) {
it('should transform css with multiple processors', function (cb) {

const stream = postcss(
[ asyncDoubler, objectDoubler() ]
);
[ asyncDoubler, objectDoubler() ]
);

stream.on('data', function (file) {
const result = file.contents.toString('utf8');
Expand Down Expand Up @@ -99,12 +99,12 @@ it('should generate source maps', function (cb) {
const init = sourceMaps.init();
const write = sourceMaps.write();
const css = postcss(
[ doubler, asyncDoubler ]
);
[ doubler, asyncDoubler ]
);

init
.pipe(css)
.pipe(write);
.pipe(css)
.pipe(write);

write.on('data', function (file) {
assert.equal(file.sourceMap.mappings, 'AAAA,IAAI,aAAY,CAAZ,aAAY,CAAZ,aAAY,CAAZ,YAAY,EAAE');
Expand All @@ -127,8 +127,8 @@ it('should correctly generate relative source map', function (cb) {

const init = sourceMaps.init();
const css = postcss(
[ doubler, doubler ]
);
[ doubler, doubler ]
);

init.pipe(css);

Expand Down Expand Up @@ -528,8 +528,8 @@ describe('<style> tag', function () {
}

const stream = postcss(
[ asyncDoubler, objectDoubler() ]
);
[ asyncDoubler, objectDoubler() ]
);

stream.on('data', function (file) {
const result = file.contents.toString('utf8');
Expand All @@ -552,8 +552,8 @@ describe('<style> tag', function () {
}

const stream = postcss(
[ asyncDoubler, objectDoubler() ]
);
[ asyncDoubler, objectDoubler() ]
);

stream.on('data', function (file) {
const result = file.contents.toString('utf8');
Expand Down

0 comments on commit fe18e28

Please sign in to comment.