Comparing version 19.0.0 to 19.1.0
const chalk = require('chalk') | ||
const { process, console, Error } = require('./src/globals') | ||
const { process, console } = require('./src/globals') | ||
@@ -17,5 +17,5 @@ module.exports = function (error) { | ||
} else { | ||
console.error(chalk.red(error.message)) | ||
console.error(chalk.red(error.toString())) | ||
} | ||
} | ||
} |
{ | ||
"name": "sergeant", | ||
"version": "19.0.0", | ||
"version": "19.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
module.exports = { | ||
process, | ||
console, | ||
Error | ||
console | ||
} |
20
test.js
@@ -513,6 +513,2 @@ const test = require('tape') | ||
}, | ||
Error: function Error (message, stack) { | ||
this.message = message | ||
this.stack = stack | ||
}, | ||
console: { | ||
@@ -529,6 +525,14 @@ error (message) { | ||
error(new globals.Error('testing errors', ['testing errors', 'at thing (file.js:123:45)', 'at another'].join('\n'))) | ||
const error1 = new Error('testing errors') | ||
error(new globals.Error('testing errors')) | ||
error1.stack = ['Error: testing errors', 'at thing (file.js:123:45)', 'at another'].join('\n') | ||
error(error1) | ||
const error2 = new Error('testing errors') | ||
error2.stack = null | ||
error(error2) | ||
error() | ||
@@ -541,6 +545,6 @@ | ||
t.deepEquals([ | ||
chalk.red('testing errors'), | ||
chalk.red('Error: testing errors'), | ||
chalk.gray('at thing ') + '(file.js:123:45)', | ||
chalk.gray('at another'), | ||
chalk.red('testing errors') | ||
chalk.red('Error: testing errors') | ||
], messages) | ||
@@ -547,0 +551,0 @@ |
30788
963