diff --git a/.travis.yml b/.travis.yml index ca220d2..66bbf54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ sudo: false language: node_js node_js: - node + - 10 - 8 - 6 script: diff --git a/CHANGELOG.md b/CHANGELOG.md index ed7df09..5a22000 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 6.1.2 / 2019-02-22 + +- Upgrade dependency globby to fix bug in sub-dependency ([#265](https://github.com/postcss/postcss-cli/issues/265), [#270](https://github.com/postcss/postcss-cli/pull/270)) + # 6.1.1 / 2019-01-04 - Fix empty lines being printed in some cases ([#256](https://github.com/postcss/postcss-cli/issues/256), [#257](https://github.com/postcss/postcss-cli/pull/257)) diff --git a/package.json b/package.json index 9513816..1ca2c78 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "postcss-cli", - "version": "6.1.1", + "version": "6.1.2", "description": "CLI for PostCSS", "main": "index.js", "engines": { @@ -23,7 +23,7 @@ "dependency-graph": "^0.8.0", "fs-extra": "^7.0.0", "get-stdin": "^6.0.0", - "globby": "^8.0.0", + "globby": "^9.0.0", "postcss": "^7.0.0", "postcss-load-config": "^2.0.0", "postcss-reporter": "^6.0.0", @@ -38,7 +38,7 @@ "eslint-config-problems": "2.0.0", "nyc": "^13.1.0", "postcss-import": "^12.0.0", - "prettier": "~1.15.0", + "prettier": "~1.16.4", "sugarss": "^2.0.0", "uuid": "^3.0.1" }, diff --git a/test/error.js b/test/error.js index 3d7732f..d0518c4 100644 --- a/test/error.js +++ b/test/error.js @@ -4,24 +4,24 @@ import tmp from './helpers/tmp.js' import cli from './helpers/cli.js' test('multiple input files && --output', t => { - return cli(['test/fixtures/*.css', '-o', tmp()]).then(({ err, code }) => { + return cli(['test/fixtures/*.css', '-o', tmp()]).then(({ error, code }) => { t.is(code, 1, 'expected non-zero error code') - t.regex(err.toString(), /Input Error: Must use --dir or --replace/) + t.regex(error.toString(), /Input Error: Must use --dir or --replace/) }) }) test('multiple input files && writing to stdout', t => { - return cli(['test/fixtures/*.css']).then(({ err, code }) => { + return cli(['test/fixtures/*.css']).then(({ error, code }) => { t.is(code, 1, 'expected non-zero error code') - t.regex(err.toString(), /Input Error: Must use --dir or --replace/) + t.regex(error.toString(), /Input Error: Must use --dir or --replace/) }) }) test('--map && writing to stdout', t => { - return cli(['test/fixtures/a.css', '--map']).then(({ err, code }) => { + return cli(['test/fixtures/a.css', '--map']).then(({ error, code }) => { t.is(code, 1, 'expected non-zero error code') t.regex( - err.toString(), + error.toString(), /Output Error: Cannot output external sourcemaps when writing to STDOUT/ ) }) @@ -34,18 +34,18 @@ test.failing('invalid --config', t => { 'test/postcss.config.js', '-d', tmp() - ]).then(({ err, code }) => { + ]).then(({ error, code }) => { t.is(code, 1, 'expected non-zero error code') - t.regex(err.toString(), /ENOENT: no such file or directory/) + t.regex(error.toString(), /ENOENT: no such file or directory/) }) }) test('plugin not found', t => { return cli(['test/fixtures/a.css', '-u', 'postcss-plugin', '-o', tmp()]).then( - ({ err, code }) => { + ({ error, code }) => { t.is(code, 1, 'expected non-zero error code') t.regex( - err.toString(), + error.toString(), /Plugin Error: Cannot find module 'postcss-plugin'/ ) } @@ -59,18 +59,18 @@ test('plugin throws on require', t => { './test/fixtures/bad-plugin', '-o', tmp() - ]).then(({ err, code }) => { + ]).then(({ error, code }) => { t.is(code, 1, 'expected non-zero error code') - t.regex(err.toString(), /Plugin Error \(.*bad-plugin\): This fails/) + t.regex(error.toString(), /Plugin Error \(.*bad-plugin\): This fails/) }) }) test('CssSyntaxError', t => { return cli(['test/fixtures/a.css', '--parser', 'sugarss', '-o', tmp()]).then( - ({ err, code }) => { + ({ error, code }) => { t.is(code, 1, 'expected non-zero error code') t.regex( - err.toString(), + error.toString(), /CssSyntaxError: .*a.css:1:4: Unnecessary curly bracket/ ) } diff --git a/test/ext.js b/test/ext.js index 0748888..1f06ed1 100644 --- a/test/ext.js +++ b/test/ext.js @@ -11,7 +11,7 @@ test('--ext works', async t => { const { error, stderr } = await cli([ 'test/fixtures/a.sss', - '-p', + '--parser', 'sugarss', '-d', dir, diff --git a/test/helpers/cli.js b/test/helpers/cli.js index fef2086..4b939d4 100644 --- a/test/helpers/cli.js +++ b/test/helpers/cli.js @@ -6,10 +6,10 @@ export default function(args, cwd) { exec( `node ${path.resolve('bin/postcss')} ${args.join(' ')}`, { cwd }, - (err, stdout, stderr) => { + (error, stdout, stderr) => { resolve({ - code: err && err.code ? err.code : 0, - err, + code: error && error.code ? error.code : 0, + error, stdout, stderr }) diff --git a/test/watch.js b/test/watch.js index b98fa6b..aa839f7 100644 --- a/test/watch.js +++ b/test/watch.js @@ -8,9 +8,10 @@ import chokidar from 'chokidar' import ENV from './helpers/env.js' import read from './helpers/read.js' -// XXX: All the tests in these files are skipped; the tests are too flaky on the CI +// XXX: All the tests in this file are skipped on the CI; too flacky there +const testCb = process.env.CI ? test.cb.skip : test.cb -test.cb.skip('--watch works', t => { +testCb('--watch works', t => { let cp t.plan(2) @@ -80,7 +81,7 @@ test.cb.skip('--watch works', t => { setTimeout(() => t.end('test timeout'), 50000) }) -test.cb.skip('--watch postcss.config.js', t => { +testCb('--watch postcss.config.js', t => { let cp t.plan(2) @@ -160,7 +161,7 @@ test.cb.skip('--watch postcss.config.js', t => { setTimeout(() => t.end('test timeout'), 50000) }) -test.cb.skip('--watch dependencies', t => { +testCb('--watch dependencies', t => { let cp t.plan(2) @@ -229,7 +230,7 @@ test.cb.skip('--watch dependencies', t => { setTimeout(() => t.end('test timeout'), 50000) }) -test.cb.skip("--watch doesn't exit on CssSyntaxError", t => { +testCb("--watch doesn't exit on CssSyntaxError", t => { t.plan(0) ENV('', ['a.css'])