@@ -8,14 +8,13 @@ var debug = require('debug')('ava');
8
8
var AvaError = require ( './ava-error' ) ;
9
9
var doSend = require ( './send' ) ;
10
10
11
- var fixNpmLink = fs . realpathSync ( __filename ) !== __filename ;
12
-
13
- if ( fixNpmLink ) {
14
- // Workaround for breakage caused by https://github.com/nodejs/node/pull/5950
15
- // Those changes will be reverted in https://github.com/nodejs/node/pull/6537
16
-
17
- // Revert #815 and #827 when the above changes land in Node.js
18
- console . warn ( 'WARNING: `npm link ava` detected: This breaks NYC coverage on early versions of Node 6.\nSee https://github.com/avajs/ava/pull/815' ) ;
11
+ if ( fs . realpathSync ( __filename ) !== __filename ) {
12
+ console . warn (
13
+ 'WARNING: `npm link ava` and the `--preserve-symlink` flag are incompatible. ' +
14
+ 'We have detected that AVA is linked via `npm link`, and that your are using either using ether ' +
15
+ 'an early version of Node 6, or the `--preserve-symlink` flag. This breaks AVA. ' +
16
+ 'You should upgrade to Node 6.2.0+, avoid the `--preserve-symlink` flag, or avoid using `npm link ava`.'
17
+ ) ;
19
18
}
20
19
21
20
var env = process . env ;
@@ -42,47 +41,11 @@ module.exports = function (file, opts) {
42
41
} : false
43
42
} , opts ) ;
44
43
45
- var ps ;
46
-
47
- if ( fixNpmLink ) {
48
- // Workaround for breakage caused by https://github.com/nodejs/node/pull/5950
49
- // Those changes will be reverted in https://github.com/nodejs/node/pull/6537
50
-
51
- // Revert #815 and #827 when the above changes land in Node.js
52
- var execArgv = process . execArgv ;
53
- var cwd = path . dirname ( file ) ;
54
-
55
- // This whole if statement is copied straight out of Nodes `child_process`
56
- if ( process . _eval != null ) { // eslint-disable-line
57
- var index = execArgv . lastIndexOf ( process . _eval ) ;
58
- if ( index > 0 ) {
59
- // Remove the -e switch to avoid fork bombing ourselves.
60
- execArgv = execArgv . slice ( ) ;
61
- execArgv . splice ( index - 1 , 2 ) ;
62
- }
63
- }
64
-
65
- var testWorkerPath = path . join ( __dirname , 'test-worker.js' ) ;
66
-
67
- var args = execArgv . concat ( [
68
- '-e' ,
69
- 'require(' + JSON . stringify ( testWorkerPath ) + ')' ,
70
- testWorkerPath ,
71
- JSON . stringify ( opts )
72
- ] ) ;
73
-
74
- ps = childProcess . spawn ( process . execPath , args , {
75
- cwd : cwd ,
76
- stdio : [ 'pipe' , 'pipe' , 'pipe' , 'ipc' ] ,
77
- env : env
78
- } ) ;
79
- } else {
80
- ps = childProcess . fork ( path . join ( __dirname , 'test-worker.js' ) , [ JSON . stringify ( opts ) ] , {
81
- cwd : path . dirname ( file ) ,
82
- silent : true ,
83
- env : env
84
- } ) ;
85
- }
44
+ var ps = childProcess . fork ( path . join ( __dirname , 'test-worker.js' ) , [ JSON . stringify ( opts ) ] , {
45
+ cwd : path . dirname ( file ) ,
46
+ silent : true ,
47
+ env : env
48
+ } ) ;
86
49
87
50
var relFile = path . relative ( '.' , file ) ;
88
51
0 commit comments