Skip to content

Commit b49813e

Browse files
committed
test: fix cache tests in windows
1 parent 3b08c78 commit b49813e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

test/lib/cache.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const t = require('tap')
22
const requireInject = require('require-inject')
3+
const path = require('path')
34

45
const usageUtil = () => 'usage instructions'
56

@@ -95,7 +96,7 @@ t.test('cache clean (force)', t => {
9596

9697
cache(['clear'], err => {
9798
t.ifError(err)
98-
t.equal(rimrafPath, '/fake/path/_cacache')
99+
t.equal(rimrafPath, path.join(npm.prefix, '_cacache'))
99100
t.end()
100101
})
101102
})
@@ -168,7 +169,7 @@ t.test('cache verify', t => {
168169
cache(['verify'], err => {
169170
t.ifError(err)
170171
t.match(outputOutput, [
171-
'Cache verified and compressed (/fake/path/_cacache)',
172+
`Cache verified and compressed (${path.join(npm.cache, '_cacache')})`,
172173
'Content verified: 1 (100 bytes)',
173174
'Index entries: 1',
174175
'Finished in 2s'
@@ -196,7 +197,7 @@ t.test('cache verify w/ extra output', t => {
196197
cache(['check'], err => {
197198
t.ifError(err)
198199
t.match(outputOutput, [
199-
'Cache verified and compressed (~/fake/path/_cacache)',
200+
`Cache verified and compressed (${path.join(npm.cache, '_cacache')})`,
200201
'Content verified: 1 (100 bytes)',
201202
'Corrupted content removed: 1',
202203
'Content garbage-collected: 2 (200 bytes)',

0 commit comments

Comments
 (0)