Skip to content

Commit

Permalink
Update dev/dependencies. Ensure is functional with webpack 4.
Browse files Browse the repository at this point in the history
  • Loading branch information
timoxley committed Mar 3, 2018
1 parent 9956901 commit 55c0337
Show file tree
Hide file tree
Showing 5 changed files with 441 additions and 417 deletions.
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ module.exports = function standardLoader (input, map) {

if (config.snazzy !== false) {
snazzy({encoding: 'utf8'})
.on('data', function (data) {
emit(new StandardJSError(data))
})
.end(warnings.join('\n'))
.on('data', function (data) {
emit(new StandardJSError(data))
})
.end(warnings.join('\n'))
} else {
warnings.forEach(function (warning) {
emit(new StandardJSError(warning))
Expand Down
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@
"author": "Tim Oxley <[email protected]>",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.23.1",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.3.2",
"node-libs-browser": "^2.0.0",
"standard": "^9.0.0",
"babel-core": "^6.26.0",
"babel-eslint": "^8.2.2",
"babel-loader": "^7.1.3",
"has-ansi": "^3.0.0",
"node-libs-browser": "^2.1.0",
"standard": "^11.0.0",
"standardx": "^1.0.3",
"tape": "^4.6.3",
"webpack": "^2.2.1"
"tape": "^4.9.0",
"webpack": "^4.0.1"
},
"standard": {
"parser": "babel-eslint"
},
"dependencies": {
"loader-utils": "^1.0.2",
"loader-utils": "^1.1.0",
"object-assign": "^4.1.1",
"snazzy": "^6.0.0"
"snazzy": "^7.1.1"
},
"peerDependencies": {
"standard": "*"
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require('path')
const config = {
mode: 'development',
entry: {
fail: path.join(__dirname, 'fail.js'),
pass: path.join(__dirname, 'pass.js')
Expand Down
5 changes: 3 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var test = require('tape')
var webpack = require('webpack')
var config = require('./fixtures/webpack.config')
var assign = require('object-assign')
var hasAnsi = require('has-ansi')

test('logs warning with snazzy', function (t) {
webpack(config, function (err, stats) {
Expand All @@ -13,7 +14,7 @@ test('logs warning with snazzy', function (t) {
}), 'has warning about semicolon')

t.ok(stats.compilation.warnings.every(function (warning) {
return warning.message.indexOf('\n\u001b') !== -1
return hasAnsi(warning.message)
}), 'uses snazzy output')
t.end()
})
Expand All @@ -36,7 +37,7 @@ test('can disable snazzy output', function (t) {
}), 'has warning about semicolon')

t.ok(stats.compilation.warnings.every(function (warning) {
return warning.message.indexOf('\n\u001b') === -1
return !hasAnsi(warning.message)
}), 'snazzy output disabled')
t.end()
})
Expand Down
Loading

0 comments on commit 55c0337

Please sign in to comment.