Skip to content

Commit 04a0f0c

Browse files
committedOct 30, 2019
Keep home dir out of snapshots
1 parent ae7c912 commit 04a0f0c

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed
 

‎tap-snapshots/test-bin.js-TAP.test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Object {
3838
"exitlog": Array [],
3939
"loglog": Array [
4040
Array [
41-
"{\\n \\"method\\": \\"extract\\",\\n \\"spec\\": \\"npm@latest-6\\",\\n \\"dest\\": \\"folder\\",\\n \\"conf\\": {\\n \\"_\\": [\\n \\"extract\\",\\n \\"npm@latest-6\\",\\n \\"folder\\"\\n ],\\n \\"json\\": true,\\n \\"cache\\": \\"/Users/isaacs/.npm/_cacache\\"\\n }\\n}",
41+
"{\\n \\"method\\": \\"extract\\",\\n \\"spec\\": \\"npm@latest-6\\",\\n \\"dest\\": \\"folder\\",\\n \\"conf\\": {\\n \\"_\\": [\\n \\"extract\\",\\n \\"npm@latest-6\\",\\n \\"folder\\"\\n ],\\n \\"json\\": true,\\n \\"cache\\": \\"{HOME}/.npm/_cacache\\"\\n }\\n}",
4242
],
4343
],
4444
}
@@ -57,7 +57,7 @@ Object {
5757
"npm@latest-6",
5858
"folder",
5959
],
60-
"cache": "/Users/isaacs/.npm/_cacache",
60+
"cache": "{HOME}/.npm/_cacache",
6161
"json": false,
6262
},
6363
"dest": "folder",
@@ -75,7 +75,7 @@ Object {
7575
"exitlog": Array [],
7676
"loglog": Array [
7777
Array [
78-
"{\\n \\"method\\": \\"manifest\\",\\n \\"spec\\": \\"bar@foo\\",\\n \\"conf\\": {\\n \\"_\\": [\\n \\"manifest\\",\\n \\"bar@foo\\"\\n ],\\n \\"json\\": true,\\n \\"cache\\": \\"/Users/isaacs/.npm/_cacache\\"\\n }\\n}",
78+
"{\\n \\"method\\": \\"manifest\\",\\n \\"spec\\": \\"bar@foo\\",\\n \\"conf\\": {\\n \\"_\\": [\\n \\"manifest\\",\\n \\"bar@foo\\"\\n ],\\n \\"json\\": true,\\n \\"cache\\": \\"{HOME}/.npm/_cacache\\"\\n }\\n}",
7979
],
8080
],
8181
}
@@ -87,7 +87,7 @@ Object {
8787
"exitlog": Array [],
8888
"loglog": Array [
8989
Array [
90-
"{\\n \\"method\\": \\"packument\\",\\n \\"spec\\": \\"paku@mint\\",\\n \\"conf\\": {\\n \\"_\\": [\\n \\"packument\\",\\n \\"paku@mint\\"\\n ],\\n \\"json\\": true,\\n \\"cache\\": \\"/Users/isaacs/.npm/_cacache\\"\\n }\\n}",
90+
"{\\n \\"method\\": \\"packument\\",\\n \\"spec\\": \\"paku@mint\\",\\n \\"conf\\": {\\n \\"_\\": [\\n \\"packument\\",\\n \\"paku@mint\\"\\n ],\\n \\"json\\": true,\\n \\"cache\\": \\"{HOME}/.npm/_cacache\\"\\n }\\n}",
9191
],
9292
],
9393
}
@@ -113,7 +113,7 @@ Object {
113113
"exitlog": Array [],
114114
"loglog": Array [
115115
Array [
116-
"{\\n \\"method\\": \\"resolve\\",\\n \\"spec\\": \\"foo@bar\\",\\n \\"conf\\": {\\n \\"_\\": [\\n \\"resolve\\",\\n \\"foo@bar\\"\\n ],\\n \\"json\\": true,\\n \\"cache\\": \\"/Users/isaacs/.npm/_cacache\\"\\n }\\n}",
116+
"{\\n \\"method\\": \\"resolve\\",\\n \\"spec\\": \\"foo@bar\\",\\n \\"conf\\": {\\n \\"_\\": [\\n \\"resolve\\",\\n \\"foo@bar\\"\\n ],\\n \\"json\\": true,\\n \\"cache\\": \\"{HOME}/.npm/_cacache\\"\\n }\\n}",
117117
],
118118
],
119119
}
@@ -125,7 +125,7 @@ Object {
125125
"exitlog": Array [],
126126
"loglog": Array [
127127
Array [
128-
"{\\n \\"method\\": \\"tarball\\",\\n \\"spec\\": \\"tar@ball\\",\\n \\"file\\": \\"file.tgz\\",\\n \\"conf\\": {\\n \\"_\\": [\\n \\"tarball\\",\\n \\"tar@ball\\",\\n \\"file.tgz\\"\\n ],\\n \\"json\\": true,\\n \\"cache\\": \\"/Users/isaacs/.npm/_cacache\\"\\n }\\n}",
128+
"{\\n \\"method\\": \\"tarball\\",\\n \\"spec\\": \\"tar@ball\\",\\n \\"file\\": \\"file.tgz\\",\\n \\"conf\\": {\\n \\"_\\": [\\n \\"tarball\\",\\n \\"tar@ball\\",\\n \\"file.tgz\\"\\n ],\\n \\"json\\": true,\\n \\"cache\\": \\"{HOME}/.npm/_cacache\\"\\n }\\n}",
129129
],
130130
],
131131
}

‎test/bin.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ const {main, run, usage, parseArg, parse} = require('../lib/bin.js')
33
const {spawn} = require('child_process')
44
const t = require('tap')
55
const version = require('../package.json').version
6-
t.cleanSnapshot = str => str.split(version).join('{VERSION}')
6+
t.cleanSnapshot = str =>
7+
str.split(version).join('{VERSION}')
8+
.split(process.env.HOME).join('{HOME}')
79

810
const pacote = require('../')
911
const called = []

0 commit comments

Comments
 (0)
Please sign in to comment.