File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
var setImmediate = require ( 'set-immediate-shim' ) ;
3
3
var hasFlag = require ( 'has-flag' ) ;
4
+ var chalk = require ( 'chalk' ) ;
5
+ var relative = require ( 'path' ) . relative ;
4
6
var serializeError = require ( 'serialize-error' ) ;
5
7
var Runner = require ( './lib/runner' ) ;
8
+ var log = require ( './lib/logger' ) ;
6
9
var runner = new Runner ( ) ;
7
10
11
+ // check if the test is being run without AVA cli
12
+ var isForked = typeof process . send === 'function' ;
13
+
14
+ if ( ! isForked ) {
15
+ var path = relative ( '.' , process . argv [ 1 ] ) ;
16
+
17
+ log . write ( ) ;
18
+ log . error ( 'Test files must be run with the AVA CLI:\n\n ' + chalk . grey . dim ( '$' ) + ' ' + chalk . cyan ( 'ava ' + path ) + '\n' ) ;
19
+
20
+ process . exit ( 1 ) ;
21
+ }
22
+
8
23
// if fail-fast is enabled, use this variable to detect,
9
24
// that no more tests should be logged
10
25
var isFailed = false ;
You can’t perform that action at this time.
0 commit comments