Skip to content

Commit

Permalink
relative file path and colors
Browse files Browse the repository at this point in the history
  • Loading branch information
jamestalmage committed Apr 10, 2016
1 parent 1f431c4 commit 9a6d76a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions lib/fork.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ if (env.NODE_PATH) {
module.exports = function (file, opts) {
opts = objectAssign({
file: file,
baseDir: process.cwd(),
tty: process.stdout.isTTY ? {
columns: process.stdout.columns,
rows: process.stdout.rows
Expand Down
13 changes: 8 additions & 5 deletions lib/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
'use strict';
var path = require('path');
var chalk = require('chalk');
var inspect = require('util').inspect;
var isGeneratorFn = require('is-generator-fn');
var maxTimeout = require('max-timeout');
Expand Down Expand Up @@ -72,14 +74,15 @@ Test.prototype._setAssertError = function (err) {
if (data) {
console.error(
[
'Improper usage of t.throws detected at %s (%d:%d).',
'Improper usage of t.throws detected at ' + chalk.bold.yellow('%s (%d:%d)') + '.',
'You should wrap the following expression in a function:',
' %s',
chalk.cyan(' %s'),
'Like this:',
' function() {\n %s\n }',
'See https://github.com/sindresorhus/ava#throwsfunctionpromise-error-message for more details.'
chalk.cyan(' function() {\n %s\n }'),
'Visit the following URL for more details:',
' ' + chalk.blue.underline('https://github.com/sindresorhus/ava#throwsfunctionpromise-error-message')
].join('\n\n'),
data.filename,
path.relative(globals.options.baseDir, data.filename),
data.line,
data.column,
data.source,
Expand Down

0 comments on commit 9a6d76a

Please sign in to comment.