File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ if (env.NODE_PATH) {
24
24
module . exports = function ( file , opts ) {
25
25
opts = objectAssign ( {
26
26
file : file ,
27
+ baseDir : process . cwd ( ) ,
27
28
tty : process . stdout . isTTY ? {
28
29
columns : process . stdout . columns ,
29
30
rows : process . stdout . rows
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
+ var path = require ( 'path' ) ;
2
3
var inspect = require ( 'util' ) . inspect ;
4
+ var chalk = require ( 'chalk' ) ;
3
5
var isGeneratorFn = require ( 'is-generator-fn' ) ;
4
6
var maxTimeout = require ( 'max-timeout' ) ;
5
7
var Promise = require ( 'bluebird' ) ;
@@ -72,14 +74,15 @@ Test.prototype._setAssertError = function (err) {
72
74
if ( data ) {
73
75
console . error (
74
76
[
75
- 'Improper usage of t.throws detected at %s (%d:%d).' ,
77
+ 'Improper usage of t.throws detected at ' + chalk . bold . yellow ( ' %s (%d:%d)' ) + ' .',
76
78
'You should wrap the following expression in a function:' ,
77
- ' %s' ,
79
+ chalk . cyan ( ' %s' ) ,
78
80
'Like this:' ,
79
- ' function() {\n %s\n }' ,
80
- 'See https://github.com/sindresorhus/ava#throwsfunctionpromise-error-message for more details.'
81
+ chalk . cyan ( ' function() {\n %s\n }' ) ,
82
+ 'Visit the following URL for more details:' ,
83
+ ' ' + chalk . blue . underline ( 'https://github.com/sindresorhus/ava#throwsfunctionpromise-error-message' )
81
84
] . join ( '\n\n' ) ,
82
- data . filename ,
85
+ path . relative ( globals . options . baseDir , data . filename ) ,
83
86
data . line ,
84
87
data . column ,
85
88
data . source ,
You can’t perform that action at this time.
0 commit comments