Skip to main content

abstractFakeFS <P>

Hierarchy

Index

Properties

publicreadonlypathUtils

pathUtils: PathUtils<P>

Methods

abstractaccessPromise

  • accessPromise(p: P, mode?: number): Promise<void>
  • Parameters

    • p: P
    • optionalmode: number

    Returns Promise<void>

abstractaccessSync

  • accessSync(p: P, mode?: number): void
  • Parameters

    • p: P
    • optionalmode: number

    Returns void

abstractappendFilePromise

abstractappendFileSync

changeFilePromise

  • changeFilePromise(p: P, content: Buffer): Promise<void>
  • changeFilePromise(p: P, content: string, opts?: Partial<{ automaticNewlines: boolean; mode: number }>): Promise<void>
  • Parameters

    • p: P
    • content: Buffer

    Returns Promise<void>

changeFileSync

  • changeFileSync(p: P, content: Buffer): void
  • changeFileSync(p: P, content: string, opts?: Partial<{ automaticNewlines: boolean; mode: number }>): void
  • Parameters

    • p: P
    • content: Buffer

    Returns void

checksumFilePromise

  • checksumFilePromise(path: P, __namedParameters?: { algorithm?: string }): Promise<string>
  • Parameters

    • path: P
    • __namedParameters: { algorithm?: string } = {}

    Returns Promise<string>

abstractchmodPromise

  • chmodPromise(p: P, mask: number): Promise<void>
  • Parameters

    • p: P
    • mask: number

    Returns Promise<void>

abstractchmodSync

  • chmodSync(p: P, mask: number): void
  • Parameters

    • p: P
    • mask: number

    Returns void

abstractchownPromise

  • chownPromise(p: P, uid: number, gid: number): Promise<void>
  • Parameters

    • p: P
    • uid: number
    • gid: number

    Returns Promise<void>

abstractchownSync

  • chownSync(p: P, uid: number, gid: number): void
  • Parameters

    • p: P
    • uid: number
    • gid: number

    Returns void

abstractclosePromise

  • closePromise(fd: number): Promise<void>
  • Parameters

    • fd: number

    Returns Promise<void>

abstractcloseSync

  • closeSync(fd: number): void
  • Parameters

    • fd: number

    Returns void

abstractcopyFilePromise

  • copyFilePromise(sourceP: P, destP: P, flags?: number): Promise<void>
  • Parameters

    • sourceP: P
    • destP: P
    • optionalflags: number

    Returns Promise<void>

abstractcopyFileSync

  • copyFileSync(sourceP: P, destP: P, flags?: number): void
  • Parameters

    • sourceP: P
    • destP: P
    • optionalflags: number

    Returns void

copyPromise

  • copyPromise(destination: P, source: P, options?: { baseFs?: undefined; linkStrategy?: null | LinkStrategy<P>; overwrite?: boolean; stableSort?: boolean; stableTime?: boolean }): Promise<void>
  • copyPromise<P2>(destination: P, source: P2, options: { baseFs: FakeFS<P2>; linkStrategy?: null | LinkStrategy<P>; overwrite?: boolean; stableSort?: boolean; stableTime?: boolean }): Promise<void>
  • Parameters

    • destination: P
    • source: P
    • optionaloptions: { baseFs?: undefined; linkStrategy?: null | LinkStrategy<P>; overwrite?: boolean; stableSort?: boolean; stableTime?: boolean }

    Returns Promise<void>

copySync

  • copySync(destination: P, source: P, options?: { baseFs?: undefined; overwrite?: boolean }): void
  • copySync<P2>(destination: P, source: P2, options: { baseFs: FakeFS<P2>; overwrite?: boolean }): void
  • @deprecated

    Prefer using copyPromise instead


    Parameters

    • destination: P
    • source: P
    • optionaloptions: { baseFs?: undefined; overwrite?: boolean }

    Returns void

abstractcreateReadStream

  • createReadStream(p: null | P, opts?: Partial<{ encoding: BufferEncoding; fd: number }>): ReadStream
  • Parameters

    • p: null | P
    • optionalopts: Partial<{ encoding: BufferEncoding; fd: number }>

    Returns ReadStream

abstractcreateWriteStream

  • createWriteStream(p: null | P, opts?: Partial<{ encoding: BufferEncoding; fd: number; flags: a }>): WriteStream
  • Parameters

    • p: null | P
    • optionalopts: Partial<{ encoding: BufferEncoding; fd: number; flags: a }>

    Returns WriteStream

abstractexistsPromise

  • existsPromise(p: P): Promise<boolean>
  • Parameters

    • p: P

    Returns Promise<boolean>

abstractexistsSync

  • existsSync(p: P): boolean
  • Parameters

    • p: P

    Returns boolean

abstractfchmodPromise

  • fchmodPromise(fd: number, mask: number): Promise<void>
  • Parameters

    • fd: number
    • mask: number

    Returns Promise<void>

abstractfchmodSync

  • fchmodSync(fd: number, mask: number): void
  • Parameters

    • fd: number
    • mask: number

    Returns void

abstractfchownPromise

  • fchownPromise(fd: number, uid: number, gid: number): Promise<void>
  • Parameters

    • fd: number
    • uid: number
    • gid: number

    Returns Promise<void>

abstractfchownSync

  • fchownSync(fd: number, uid: number, gid: number): void
  • Parameters

    • fd: number
    • uid: number
    • gid: number

    Returns void

abstractfstatPromise

  • fstatPromise(fd: number): Promise<Stats>
  • fstatPromise(fd: number, opts: { bigint: true }): Promise<BigIntStats>
  • fstatPromise(fd: number, opts?: { bigint?: boolean }): Promise<Stats | BigIntStats>
  • Parameters

    • fd: number

    Returns Promise<Stats>

abstractfstatSync

  • Parameters

    • fd: number

    Returns Stats

abstractftruncatePromise

  • ftruncatePromise(fd: number, len?: number): Promise<void>
  • Parameters

    • fd: number
    • optionallen: number

    Returns Promise<void>

abstractftruncateSync

  • ftruncateSync(fd: number, len?: number): void
  • Parameters

    • fd: number
    • optionallen: number

    Returns void

genTraversePromise

  • genTraversePromise(init: P, __namedParameters?: { stableSort?: boolean }): AsyncGenerator<P, void, unknown>
  • Parameters

    • init: P
    • __namedParameters: { stableSort?: boolean } = {}

    Returns AsyncGenerator<P, void, unknown>

abstractgetExtractHint

abstractgetRealPath

  • getRealPath(): P
  • Returns P

abstractlinkPromise

  • linkPromise(existingP: P, newP: P): Promise<void>
  • Parameters

    • existingP: P
    • newP: P

    Returns Promise<void>

abstractlinkSync

  • linkSync(existingP: P, newP: P): void
  • Parameters

    • existingP: P
    • newP: P

    Returns void

lockPromise

  • lockPromise<T>(affectedPath: P, callback: () => Promise<T>): Promise<T>
  • Type parameters

    • T

    Parameters

    • affectedPath: P
    • callback: () => Promise<T>

    Returns Promise<T>

abstractlstatPromise

  • Parameters

    • p: P

    Returns Promise<Stats>

abstractlstatSync

  • Parameters

    • p: P

    Returns Stats

abstractlutimesPromise

  • lutimesPromise(p: P, atime: string | number | Date, mtime: string | number | Date): Promise<void>
  • Parameters

    • p: P
    • atime: string | number | Date
    • mtime: string | number | Date

    Returns Promise<void>

abstractlutimesSync

  • lutimesSync(p: P, atime: string | number | Date, mtime: string | number | Date): void
  • Parameters

    • p: P
    • atime: string | number | Date
    • mtime: string | number | Date

    Returns void

abstractmkdirPromise

  • mkdirPromise(p: P, opts?: Partial<{ mode: number; recursive: boolean }>): Promise<undefined | string>
  • Parameters

    • p: P
    • optionalopts: Partial<{ mode: number; recursive: boolean }>

    Returns Promise<undefined | string>

abstractmkdirSync

  • mkdirSync(p: P, opts?: Partial<{ mode: number; recursive: boolean }>): undefined | string
  • Parameters

    • p: P
    • optionalopts: Partial<{ mode: number; recursive: boolean }>

    Returns undefined | string

mkdirpPromise

  • mkdirpPromise(p: P, __namedParameters?: { chmod?: number; utimes?: [string | number | Date, string | number | Date] }): Promise<undefined | string>
  • Parameters

    • p: P
    • __namedParameters: { chmod?: number; utimes?: [string | number | Date, string | number | Date] } = {}

    Returns Promise<undefined | string>

mkdirpSync

  • mkdirpSync(p: P, __namedParameters?: { chmod?: number; utimes?: [string | number | Date, string | number | Date] }): undefined | string
  • Parameters

    • p: P
    • __namedParameters: { chmod?: number; utimes?: [string | number | Date, string | number | Date] } = {}

    Returns undefined | string

movePromise

  • movePromise(fromP: P, toP: P): Promise<void>
  • Parameters

    • fromP: P
    • toP: P

    Returns Promise<void>

moveSync

  • moveSync(fromP: P, toP: P): void
  • Parameters

    • fromP: P
    • toP: P

    Returns void

abstractopenPromise

  • openPromise(p: P, flags: string, mode?: number): Promise<number>
  • Parameters

    • p: P
    • flags: string
    • optionalmode: number

    Returns Promise<number>

abstractopenSync

  • openSync(p: P, flags: string, mode?: number): number
  • Parameters

    • p: P
    • flags: string
    • optionalmode: number

    Returns number

abstractopendirPromise

  • opendirPromise(p: P, opts?: Partial<{ bufferSize: number; recursive: boolean }>): Promise<Dir<P>>
  • Parameters

    • p: P
    • optionalopts: Partial<{ bufferSize: number; recursive: boolean }>

    Returns Promise<Dir<P>>

abstractopendirSync

  • opendirSync(p: P, opts?: Partial<{ bufferSize: number; recursive: boolean }>): Dir<P>
  • Parameters

    • p: P
    • optionalopts: Partial<{ bufferSize: number; recursive: boolean }>

    Returns Dir<P>

preserveTimePromise

  • preserveTimePromise(p: P, cb: () => Promise<void | P>): Promise<void>
  • Parameters

    • p: P
    • cb: () => Promise<void | P>

    Returns Promise<void>

preserveTimeSync

  • preserveTimeSync(p: P, cb: () => void | P): Promise<void>
  • Parameters

    • p: P
    • cb: () => void | P

    Returns Promise<void>

abstractreadFilePromise

  • readFilePromise(p: FSPath<P>, encoding?: null): Promise<Buffer>
  • readFilePromise(p: FSPath<P>, encoding: BufferEncoding): Promise<string>
  • readFilePromise(p: FSPath<P>, encoding?: null | BufferEncoding): Promise<string | Buffer>
  • Parameters

    • p: FSPath<P>
    • optionalencoding: null

    Returns Promise<Buffer>

abstractreadFileSync

  • readFileSync(p: FSPath<P>, encoding?: null): Buffer
  • readFileSync(p: FSPath<P>, encoding: BufferEncoding): string
  • readFileSync(p: FSPath<P>, encoding?: null | BufferEncoding): string | Buffer
  • Parameters

    • p: FSPath<P>
    • optionalencoding: null

    Returns Buffer

readJsonPromise

  • readJsonPromise(p: P): Promise<any>
  • Parameters

    • p: P

    Returns Promise<any>

readJsonSync

  • readJsonSync(p: P): any
  • Parameters

    • p: P

    Returns any

abstractreadPromise

  • readPromise(fd: number, buffer: Buffer, offset?: number, length?: number, position?: null | number): Promise<number>
  • Parameters

    • fd: number
    • buffer: Buffer
    • optionaloffset: number
    • optionallength: number
    • optionalposition: null | number

    Returns Promise<number>

abstractreadSync

  • readSync(fd: number, buffer: Buffer, offset?: number, length?: number, position?: null | number): number
  • Parameters

    • fd: number
    • buffer: Buffer
    • optionaloffset: number
    • optionallength: number
    • optionalposition: null | number

    Returns number

abstractreaddirPromise

  • readdirPromise(p: P, opts?: null): Promise<Filename[]>
  • readdirPromise(p: P, opts: { recursive?: false; withFileTypes: true }): Promise<DirentNoPath[]>
  • readdirPromise(p: P, opts: { recursive?: false; withFileTypes?: false }): Promise<Filename[]>
  • readdirPromise(p: P, opts: { recursive?: false; withFileTypes: boolean }): Promise<(Filename | DirentNoPath)[]>
  • readdirPromise(p: P, opts: { recursive: true; withFileTypes: true }): Promise<Dirent<P>[]>
  • readdirPromise(p: P, opts: { recursive: true; withFileTypes?: false }): Promise<P[]>
  • readdirPromise(p: P, opts: { recursive: true; withFileTypes: boolean }): Promise<(P | Dirent<P>)[]>
  • readdirPromise(p: P, opts: { recursive: boolean; withFileTypes: true }): Promise<(DirentNoPath | Dirent<P>)[]>
  • readdirPromise(p: P, opts: { recursive: boolean; withFileTypes?: false }): Promise<P[]>
  • readdirPromise(p: P, opts: { recursive: boolean; withFileTypes: boolean }): Promise<(P | DirentNoPath | Dirent<P>)[]>
  • readdirPromise(p: P, opts?: null | Partial<{ recursive: boolean; withFileTypes: boolean }>): Promise<(P | DirentNoPath | Dirent<P>)[]>
  • Parameters

    • p: P
    • optionalopts: null

    Returns Promise<Filename[]>

abstractreaddirSync

  • readdirSync(p: P, opts?: null): Filename[]
  • readdirSync(p: P, opts: { recursive?: false; withFileTypes: true }): DirentNoPath[]
  • readdirSync(p: P, opts: { recursive?: false; withFileTypes?: false }): Filename[]
  • readdirSync(p: P, opts: { recursive?: false; withFileTypes: boolean }): (Filename | DirentNoPath)[]
  • readdirSync(p: P, opts: { recursive: true; withFileTypes: true }): Dirent<P>[]
  • readdirSync(p: P, opts: { recursive: true; withFileTypes?: false }): P[]
  • readdirSync(p: P, opts: { recursive: true; withFileTypes: boolean }): (P | Dirent<P>)[]
  • readdirSync(p: P, opts: { recursive: boolean; withFileTypes: true }): (DirentNoPath | Dirent<P>)[]
  • readdirSync(p: P, opts: { recursive: boolean; withFileTypes?: false }): P[]
  • readdirSync(p: P, opts: { recursive: boolean; withFileTypes: boolean }): (P | DirentNoPath | Dirent<P>)[]
  • readdirSync(p: P, opts?: null | Partial<{ recursive: boolean; withFileTypes: boolean }>): (P | DirentNoPath | Dirent<P>)[]
  • Parameters

    • p: P
    • optionalopts: null

    Returns Filename[]

abstractreadlinkPromise

  • readlinkPromise(p: P): Promise<P>
  • Parameters

    • p: P

    Returns Promise<P>

abstractreadlinkSync

  • readlinkSync(p: P): P
  • Parameters

    • p: P

    Returns P

abstractrealpathPromise

  • realpathPromise(p: P): Promise<P>
  • Parameters

    • p: P

    Returns Promise<P>

abstractrealpathSync

  • realpathSync(p: P): P
  • Parameters

    • p: P

    Returns P

removePromise

  • removePromise(p: P, __namedParameters?: { maxRetries?: number; recursive?: boolean }): Promise<void>
  • Parameters

    • p: P
    • __namedParameters: { maxRetries?: number; recursive?: boolean } = {}

    Returns Promise<void>

removeSync

  • removeSync(p: P, __namedParameters?: { recursive?: boolean }): void
  • Parameters

    • p: P
    • __namedParameters: { recursive?: boolean } = {}

    Returns void

abstractrenamePromise

  • renamePromise(oldP: P, newP: P): Promise<void>
  • Parameters

    • oldP: P
    • newP: P

    Returns Promise<void>

abstractrenameSync

  • renameSync(oldP: P, newP: P): void
  • Parameters

    • oldP: P
    • newP: P

    Returns void

abstractresolve

  • resolve(p: P): P
  • Parameters

    • p: P

    Returns P

abstractrmPromise

  • rmPromise(p: P, opts?: Partial<{ force: boolean; maxRetries: number; recursive: boolean; retryDelay: number }>): Promise<void>
  • Parameters

    • p: P
    • optionalopts: Partial<{ force: boolean; maxRetries: number; recursive: boolean; retryDelay: number }>

    Returns Promise<void>

abstractrmSync

  • rmSync(p: P, opts?: Partial<{ force: boolean; maxRetries: number; recursive: boolean; retryDelay: number }>): void
  • Parameters

    • p: P
    • optionalopts: Partial<{ force: boolean; maxRetries: number; recursive: boolean; retryDelay: number }>

    Returns void

abstractrmdirPromise

  • rmdirPromise(p: P, opts?: Partial<{ maxRetries: number; recursive: boolean; retryDelay: number }>): Promise<void>
  • Parameters

    • p: P
    • optionalopts: Partial<{ maxRetries: number; recursive: boolean; retryDelay: number }>

    Returns Promise<void>

abstractrmdirSync

  • rmdirSync(p: P, opts?: Partial<{ maxRetries: number; recursive: boolean; retryDelay: number }>): void
  • Parameters

    • p: P
    • optionalopts: Partial<{ maxRetries: number; recursive: boolean; retryDelay: number }>

    Returns void

abstractstatPromise

  • Parameters

    • p: P

    Returns Promise<Stats>

abstractstatSync

  • Parameters

    • p: P

    Returns Stats

abstractsymlinkPromise

  • symlinkPromise(target: P, p: P, type?: SymlinkType): Promise<void>
  • Parameters

    Returns Promise<void>

abstractsymlinkSync

  • Parameters

    Returns void

abstracttruncatePromise

  • truncatePromise(p: P, len?: number): Promise<void>
  • Parameters

    • p: P
    • optionallen: number

    Returns Promise<void>

abstracttruncateSync

  • truncateSync(p: P, len?: number): void
  • Parameters

    • p: P
    • optionallen: number

    Returns void

abstractunlinkPromise

  • unlinkPromise(p: P): Promise<void>
  • Parameters

    • p: P

    Returns Promise<void>

abstractunlinkSync

  • unlinkSync(p: P): void
  • Parameters

    • p: P

    Returns void

abstractunwatchFile

abstractutimesPromise

  • utimesPromise(p: P, atime: string | number | Date, mtime: string | number | Date): Promise<void>
  • Parameters

    • p: P
    • atime: string | number | Date
    • mtime: string | number | Date

    Returns Promise<void>

abstractutimesSync

  • utimesSync(p: P, atime: string | number | Date, mtime: string | number | Date): void
  • Parameters

    • p: P
    • atime: string | number | Date
    • mtime: string | number | Date

    Returns void

abstractwatch

abstractwatchFile

abstractwriteFilePromise

abstractwriteFileSync

writeJsonPromise

  • writeJsonPromise(p: P, data: any, __namedParameters?: { compact?: boolean }): Promise<void>
  • Parameters

    • p: P
    • data: any
    • __namedParameters: { compact?: boolean } = {}

    Returns Promise<void>

writeJsonSync

  • writeJsonSync(p: P, data: any, __namedParameters?: { compact?: boolean }): void
  • Parameters

    • p: P
    • data: any
    • __namedParameters: { compact?: boolean } = {}

    Returns void

abstractwritePromise

  • writePromise(fd: number, buffer: Buffer, offset?: number, length?: number, position?: number): Promise<number>
  • writePromise(fd: number, buffer: string, position?: number): Promise<number>
  • Parameters

    • fd: number
    • buffer: Buffer
    • optionaloffset: number
    • optionallength: number
    • optionalposition: number

    Returns Promise<number>

abstractwriteSync

  • writeSync(fd: number, buffer: Buffer, offset?: number, length?: number, position?: number): number
  • writeSync(fd: number, buffer: string, position?: number): number
  • Parameters

    • fd: number
    • buffer: Buffer
    • optionaloffset: number
    • optionallength: number
    • optionalposition: number

    Returns number