File tree 3 files changed +7
-12
lines changed
3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ export default async function () {
41
41
setGlobalVariable ( 'npm-global' , npmModulesPrefix ) ;
42
42
setGlobalVariable ( 'yarn-global' , yarnModulesPrefix ) ;
43
43
44
+ // Disable all update/notification related npm/yarn features such as the NPM updater notifier.
45
+ // The NPM updater notifier may prevent the child process from closing until it timeouts after 3 minutes.
46
+ process . env . NO_UPDATE_NOTIFIER = '1' ;
47
+ process . env . NPM_CONFIG_UPDATE_NOTIFIER = 'false' ;
48
+
44
49
console . log ( ` Using "${ npmModulesPrefix } " as e2e test global npm bin dir.` ) ;
45
50
console . log ( ` Using "${ yarnModulesPrefix } " as e2e test global yarn bin dir.` ) ;
46
51
}
Original file line number Diff line number Diff line change 1
1
import * as assert from 'assert' ;
2
- import { execSync } from 'child_process' ;
3
2
import { valid as validSemVer } from 'semver' ;
4
3
import { rimraf } from '../../utils/fs' ;
5
4
import { getActivePackageManager } from '../../utils/packages' ;
@@ -21,16 +20,7 @@ export default async function () {
21
20
}
22
21
23
22
// Get current package manager version to restore after tests
24
- const initialVersionText = execSync ( 'npm --version' , {
25
- encoding : 'utf8' ,
26
- stdio : [ 'ignore' , 'pipe' , 'ignore' ] ,
27
- env : {
28
- ...process . env ,
29
- // NPM updater notifier will prevent the child process from closing until it timeouts after 3 minutes.
30
- NO_UPDATE_NOTIFIER : '1' ,
31
- NPM_CONFIG_UPDATE_NOTIFIER : 'false' ,
32
- } ,
33
- } ) . trim ( ) ;
23
+ const initialVersionText = ( await npm ( '--version' ) ) . stdout . trim ( ) ;
34
24
const initialVersion = validSemVer ( initialVersionText ) ;
35
25
assert . ok (
36
26
initialVersion ,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ interface ExecOptions {
16
16
cwd ?: string ;
17
17
}
18
18
19
- const NPM_CONFIG_RE = / ^ ( n p m _ c o n f i g _ | y a r n _ ) / i;
19
+ const NPM_CONFIG_RE = / ^ ( n p m _ c o n f i g _ | y a r n _ | n o _ u p d a t e _ n o t i f i e r ) / i;
20
20
21
21
let _processes : child_process . ChildProcess [ ] = [ ] ;
22
22
You can’t perform that action at this time.
0 commit comments