@@ -17,12 +17,12 @@ permissionError.code = 'EPERM'
17
17
18
18
// helpers
19
19
const getRead = ( t , opts ) => t . mock ( '../../lib/content/read' , opts )
20
- const getReadLstatFailure = ( t , err ) => getRead ( t , {
20
+ const getReadStatFailure = ( t , err ) => getRead ( t , {
21
21
'@npmcli/fs' : Object . assign ( { } , require ( '@npmcli/fs' ) , {
22
- async lstat ( path ) {
22
+ async stat ( path ) {
23
23
throw err
24
24
} ,
25
- lstatSync ( ) {
25
+ statSync ( ) {
26
26
throw err
27
27
} ,
28
28
} ) ,
@@ -261,7 +261,7 @@ t.test('read: opening large files', function (t) {
261
261
const CACHE = t . testdir ( )
262
262
const mockedRead = getRead ( t , {
263
263
'@npmcli/fs' : Object . assign ( { } , require ( '@npmcli/fs' ) , {
264
- async lstat ( path ) {
264
+ async stat ( path ) {
265
265
return { size : Number . MAX_SAFE_INTEGER }
266
266
} ,
267
267
} ) ,
@@ -370,7 +370,7 @@ t.test('hasContent: tests content existence', (t) => {
370
370
t . test ( 'hasContent: permission error' , ( t ) => {
371
371
const CACHE = t . testdir ( )
372
372
// setup a syntetic permission error
373
- const mockedRead = getReadLstatFailure ( t , permissionError )
373
+ const mockedRead = getReadStatFailure ( t , permissionError )
374
374
375
375
t . plan ( 1 )
376
376
t . rejects (
@@ -382,7 +382,7 @@ t.test('hasContent: permission error', (t) => {
382
382
383
383
t . test ( 'hasContent: generic error' , ( t ) => {
384
384
const CACHE = t . testdir ( )
385
- const mockedRead = getReadLstatFailure ( t , genericError )
385
+ const mockedRead = getReadStatFailure ( t , genericError )
386
386
387
387
t . plan ( 1 )
388
388
t . resolves (
@@ -426,7 +426,7 @@ t.test('hasContent.sync: checks content existence synchronously', (t) => {
426
426
427
427
t . test ( 'hasContent.sync: permission error' , ( t ) => {
428
428
const CACHE = t . testdir ( )
429
- const mockedRead = getReadLstatFailure ( t , permissionError )
429
+ const mockedRead = getReadStatFailure ( t , permissionError )
430
430
431
431
t . throws (
432
432
( ) => mockedRead . hasContent . sync ( CACHE , 'sha1-deadbeef sha1-13371337' ) ,
@@ -438,7 +438,7 @@ t.test('hasContent.sync: permission error', (t) => {
438
438
439
439
t . test ( 'hasContent.sync: generic error' , ( t ) => {
440
440
const CACHE = t . testdir ( )
441
- const mockedRead = getReadLstatFailure ( t , genericError )
441
+ const mockedRead = getReadStatFailure ( t , genericError )
442
442
443
443
t . notOk (
444
444
mockedRead . hasContent . sync ( CACHE , 'sha1-deadbeef sha1-13371337' ) ,
0 commit comments