Skip to content

Commit 9b392e4

Browse files
authored
disable update-notifier using env
1 parent 912bdee commit 9b392e4

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

test/cli.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
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';
45
import {execFile} from 'node:child_process';
56
import mockery from 'mockery';
67
import sinon from 'sinon';
@@ -9,6 +10,9 @@ import {getDirname} from '../lib/utils/node-shims.js';
910

1011
const __dirname = getDirname(import.meta.url);
1112

13+
// Disable update-notifier
14+
process.env.NODE_ENV = 'test';
15+
1216
describe('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

Comments
 (0)