11'use strict' ;
2- import path from 'path' ;
3- import assert from 'assert' ;
2+ import path from 'node:path' ;
3+ import assert from 'node:assert' ;
4+ import process from 'node:process' ;
45import { execFile } from 'node:child_process' ;
56import mockery from 'mockery' ;
67import sinon from 'sinon' ;
@@ -9,6 +10,9 @@ import {getDirname} from '../lib/utils/node-shims.js';
910
1011const __dirname = getDirname ( import . meta. url ) ;
1112
13+ // Disable update-notifier
14+ process . env . NODE_ENV = 'test' ;
15+
1216describe ( 'bin' , ( ) => {
1317 describe ( 'mocked' , ( ) => {
1418 beforeEach ( async function ( ) {
@@ -60,8 +64,7 @@ describe('bin', () => {
6064 it ( 'should return the version' , cb => {
6165 const cp = execFile ( 'node' , [
6266 path . resolve ( __dirname , '..' , pkg . bin . yo ) ,
63- '--version' ,
64- '--no-update-notifier'
67+ '--version'
6568 ] ) ;
6669 const expected = pkg . version ;
6770
@@ -72,7 +75,7 @@ describe('bin', () => {
7275 } ) ;
7376
7477 it ( 'should output available generators when `--generators` flag is supplied' , cb => {
75- const cp = execFile ( 'node' , [ path . resolve ( __dirname , '..' , pkg . bin . yo ) , '--generators' , '--no-update-notifier' ] ) ;
78+ const cp = execFile ( 'node' , [ path . resolve ( __dirname , '..' , pkg . bin . yo ) , '--generators' ] ) ;
7679
7780 cp . stdout . once ( 'data' , data => {
7881 assert ( data . length > 0 ) ;
@@ -85,8 +88,7 @@ describe('bin', () => {
8588 const cp = execFile ( 'node' , [
8689 path . resolve ( __dirname , '..' , pkg . bin . yo ) ,
8790 '--generators' ,
88- '--local-only' ,
89- '--no-update-notifier'
91+ '--local-only'
9092 ] ) ;
9193
9294 cp . stdout . once ( 'data' , data => {
0 commit comments