Skip to content

Commit 95c7d68

Browse files
committed
update config related tests
1 parent b2268b3 commit 95c7d68

File tree

2 files changed

+28
-24
lines changed

2 files changed

+28
-24
lines changed

tap-snapshots/test-lib-utils-config.js-TAP.test.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Object {
2929
"cafile": null,
3030
"call": "",
3131
"cert": null,
32+
"ci-name": null,
3233
"cidr": null,
3334
"color": true,
3435
"commit-hooks": true,
@@ -78,6 +79,7 @@ Object {
7879
"node-options": null,
7980
"node-version": "v14.8.0",
8081
"noproxy": null,
82+
"npm-version": "7.0.0",
8183
"offline": false,
8284
"omit": Array [],
8385
"only": null,
@@ -201,9 +203,6 @@ Object {
201203
"n": Array [
202204
"--no-yes",
203205
],
204-
"N": Array [
205-
"--no-registry",
206-
],
207206
"no-desc": Array [
208207
"--no-description",
209208
],
@@ -317,6 +316,10 @@ Object {
317316
null,
318317
"{String TYPE}",
319318
],
319+
"ci-name": Array [
320+
null,
321+
"{String TYPE}",
322+
],
320323
"cidr": Array [
321324
null,
322325
"{String TYPE}",
@@ -349,10 +352,6 @@ Object {
349352
"global": "{Boolean TYPE}",
350353
"global-style": "{Boolean TYPE}",
351354
"globalconfig": "{PATH MODULE}",
352-
"group": Array [
353-
"{Number TYPE}",
354-
"{String TYPE}",
355-
],
356355
"heading": "{String TYPE}",
357356
"https-proxy": Array [
358357
null,
@@ -421,6 +420,7 @@ Object {
421420
"{String TYPE}",
422421
"{Array TYPE}",
423422
],
423+
"npm-version": "{SEMVER MODULE}",
424424
"offline": "{Boolean TYPE}",
425425
"omit": Array [
426426
"{Array TYPE}",
@@ -543,6 +543,7 @@ Object {
543543
"cafile": null,
544544
"call": "",
545545
"cert": null,
546+
"ci-name": null,
546547
"cidr": null,
547548
"color": true,
548549
"commit-hooks": true,
@@ -592,6 +593,7 @@ Object {
592593
"node-options": null,
593594
"node-version": "v14.8.0",
594595
"noproxy": null,
596+
"npm-version": "7.0.0",
595597
"offline": false,
596598
"omit": Array [],
597599
"only": null,
@@ -715,9 +717,6 @@ Object {
715717
"n": Array [
716718
"--no-yes",
717719
],
718-
"N": Array [
719-
"--no-registry",
720-
],
721720
"no-desc": Array [
722721
"--no-description",
723722
],
@@ -831,6 +830,10 @@ Object {
831830
null,
832831
"{String TYPE}",
833832
],
833+
"ci-name": Array [
834+
null,
835+
"{String TYPE}",
836+
],
834837
"cidr": Array [
835838
null,
836839
"{String TYPE}",
@@ -863,10 +866,6 @@ Object {
863866
"global": "{Boolean TYPE}",
864867
"global-style": "{Boolean TYPE}",
865868
"globalconfig": "{PATH MODULE}",
866-
"group": Array [
867-
"{Number TYPE}",
868-
"{String TYPE}",
869-
],
870869
"heading": "{String TYPE}",
871870
"https-proxy": Array [
872871
null,
@@ -935,6 +934,7 @@ Object {
935934
"{String TYPE}",
936935
"{Array TYPE}",
937936
],
937+
"npm-version": "{SEMVER MODULE}",
938938
"offline": "{Boolean TYPE}",
939939
"omit": Array [
940940
"{Array TYPE}",
@@ -1057,6 +1057,7 @@ Object {
10571057
"cafile": null,
10581058
"call": "",
10591059
"cert": null,
1060+
"ci-name": null,
10601061
"cidr": null,
10611062
"color": true,
10621063
"commit-hooks": true,
@@ -1106,6 +1107,7 @@ Object {
11061107
"node-options": null,
11071108
"node-version": "v14.8.0",
11081109
"noproxy": null,
1110+
"npm-version": "7.0.0",
11091111
"offline": false,
11101112
"omit": Array [],
11111113
"only": null,
@@ -1229,9 +1231,6 @@ Object {
12291231
"n": Array [
12301232
"--no-yes",
12311233
],
1232-
"N": Array [
1233-
"--no-registry",
1234-
],
12351234
"no-desc": Array [
12361235
"--no-description",
12371236
],
@@ -1345,6 +1344,10 @@ Object {
13451344
null,
13461345
"{String TYPE}",
13471346
],
1347+
"ci-name": Array [
1348+
null,
1349+
"{String TYPE}",
1350+
],
13481351
"cidr": Array [
13491352
null,
13501353
"{String TYPE}",
@@ -1377,10 +1380,6 @@ Object {
13771380
"global": "{Boolean TYPE}",
13781381
"global-style": "{Boolean TYPE}",
13791382
"globalconfig": "{PATH MODULE}",
1380-
"group": Array [
1381-
"{Number TYPE}",
1382-
"{String TYPE}",
1383-
],
13841383
"heading": "{String TYPE}",
13851384
"https-proxy": Array [
13861385
null,
@@ -1451,6 +1450,7 @@ Object {
14511450
"{String TYPE}",
14521451
"{Array TYPE}",
14531452
],
1453+
"npm-version": "{SEMVER MODULE}",
14541454
"offline": "{Boolean TYPE}",
14551455
"omit": Array [
14561456
"{Array TYPE}",

test/lib/utils/config.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,14 @@ const networkInterfaces = () => ({
7070
})
7171
const tmpdir = () => '/tmp'
7272
const os = { networkInterfaces, tmpdir }
73+
const pkg = { version: '7.0.0' }
7374

7475
t.test('working network interfaces, not windows', t => {
7576
const config = requireInject('../../../lib/utils/config.js', {
7677
os,
7778
'@npmcli/ci-detect': () => false,
78-
'../../../lib/utils/is-windows.js': false
79+
'../../../lib/utils/is-windows.js': false,
80+
'../../../package.json': pkg
7981
})
8082
t.matchSnapshot(config)
8183
t.end()
@@ -85,7 +87,8 @@ t.test('no working network interfaces, on windows', t => {
8587
const config = requireInject('../../../lib/utils/config.js', {
8688
os: { tmpdir, networkInterfaces: networkInterfacesThrow },
8789
'@npmcli/ci-detect': () => false,
88-
'../../../lib/utils/is-windows.js': true
90+
'../../../lib/utils/is-windows.js': true,
91+
'../../../package.json': pkg
8992
})
9093
t.matchSnapshot(config)
9194
t.end()
@@ -109,7 +112,8 @@ t.test('no process.umask() method', t => {
109112
const config = requireInject('../../../lib/utils/config.js', {
110113
os: { tmpdir, networkInterfaces: networkInterfacesThrow },
111114
'@npmcli/ci-detect': () => false,
112-
'../../../lib/utils/is-windows.js': true
115+
'../../../lib/utils/is-windows.js': true,
116+
'../../../package.json': pkg
113117
})
114118
t.equal(config.defaults.umask, 0o22)
115119
t.matchSnapshot(config)

0 commit comments

Comments
 (0)