> mock-fs@4.3.0 pretest /home/agrzes/git/image-organizer/node_modules/mock-fs > eslint benchmarks lib test > mock-fs@4.3.0 test /home/agrzes/git/image-organizer/node_modules/mock-fs > mocha --recursive test count(dir, callback) 1) counts files in a directory ✓ counts files in another directory ✓ counts files in an empty directory ✓ fails for bogus path Binding constructor ✓ creates a new instance #Stats ✓ is a stats constructor #stat() ✓ calls callback with a Stats instance ✓ returns a Stats instance when called synchronously ✓ identifies files (async) ✓ identifies files (sync) ✓ identifies directories (async) ✓ identifies directories (sync) ✓ includes atime, ctime, mtime and birthtime ✓ includes mode with file permissions (default) ✓ includes mode with file permissions (custom) ✓ includes size in bytes (async) ✓ includes size in bytes (sync) ✓ includes non-zero size for directories ✓ includes uid for files ✓ includes uid for directories ✓ includes gid for files ✓ includes gid for directories ✓ retrieves stats of files relative to symbolic linked directories #realpath() ✓ returns the real path for a regular file ✓ returns the real path for a directory ✓ returns the real path for a symlinked file ✓ returns the real path for a deeply symlinked file ✓ returns the real path for a symlinked directory ✓ returns the real path for a deeply symlinked directory ✓ returns the real path for a file in a symlinked directory ✓ accepts a buffer ✓ can return a buffer ✓ throws ENOENT for a non-existent file ✓ throws ENOTDIR for a file treated like a directory #fstat() ✓ calls callback with a Stats instance ✓ returns a Stats instance when called synchronously ✓ identifies files (async) ✓ identifies directories (async) ✓ includes size in bytes (async) ✓ includes size in bytes (sync) ✓ includes non-zero size for directories #readdir() ✓ calls callback with file list ✓ accepts "buffer" encoding ✓ returns a file list (sync) ✓ calls callback with file list for symbolic linked dir ✓ calls callback with file list for link to symbolic linked dir ✓ calls callback with file list for symbolic linked dir (sync) ✓ calls callback with error for bogus dir ✓ calls callback with error for file path ✓ calls callback with error for dead symbolic link ✓ calls callback with error for symbolic link to file ✓ calls callback with error for link to symbolic link to file #open() ✓ creates a file descriptor for reading (r) ✓ generates error if file does not exist (r) ✓ creates a file descriptor for reading and writing (r+) ✓ does not truncate (r+) ✓ generates error if file does not exist (r+) ✓ creates a file descriptor for reading (rs) ✓ generates error if file does not exist (rs) ✓ creates a file descriptor for reading and writing (rs+) ✓ generates error if file does not exist (rs+) ✓ opens a new file for writing (w) ✓ truncates an existing file for writing (w) ✓ generates error if file exists (wx) ✓ opens a new file for reading and writing (w+) ✓ truncates an existing file for writing (w+) ✓ opens a new file for reading and writing (wx+) ✓ generates error if file exists (wx+) ✓ opens a new file for appending (a) ✓ opens an existing file for appending (a) ✓ opens a new file for appending (ax) ✓ generates error if file exists (ax) ✓ opens a new file for appending and reading (a+) ✓ opens an existing file for appending and reading (a+) ✓ opens a new file for appending and reading (ax+) ✓ opens an existing file for appending and reading (ax+) #close() ✓ closes an existing file descriptor ✓ fails for closed file descriptor #read() ✓ reads from a file ✓ interprets null position as current position ✓ reads from a symbolic link ✓ reads from a deeply linked symlink ✓ throws if not open for reading #write() ✓ writes to a file ✓ can overwrite a file ✓ can append to a file ✓ can overwrite part of a file ✓ throws if not open for writing #writeBuffers() ✓ writes to a file ✓ can append to a file ✓ can overwrite part of a file ✓ throws if not open for writing #rename() ✓ allows files to be renamed ✓ allows files to be renamed (sync) ✓ replaces existing files (sync) ✓ allows directories to be renamed ✓ allows directories to be renamed (sync) ✓ calls callback with error for bogus old path ✓ calls callback with error for file->dir rename ✓ calls callback with error for dir->file rename #mkdir() ✓ creates a new directory ✓ fails if parent does not exist ✓ fails if directory exists ✓ fails if file exists #mkdtemp() ✓ creates a new directory ✓ fails if parent does not exist ✓ fails if file exists #rmdir() ✓ removes an empty directory ✓ fails if directory is not empty ✓ fails if directory does not exist ✓ fails if a file exists #ftruncate() ✓ truncates a file ✓ fails if directory ✓ fails if not open for writing #chown() ✓ sets the uid and gid for a file ✓ sets the uid and gid for a directory #fchown() ✓ sets the uid and gid for a file ✓ sets the uid and gid for a directory #chmod() ✓ sets the mode for a file ✓ sets the mode for a directory #fchmod() ✓ sets the mode for a file ✓ sets the mode for a directory #unlink() ✓ deletes a file ✓ fails for directory ✓ fails for bogus path #utimes() ✓ updates atime and mtime for a file ✓ updates atime and mtime for a directory ✓ fails for a bogus path #futimes() ✓ updates atime and mtime for a file ✓ updates atime and mtime for a directory #fsync() ✓ synchronize file state (noop) ✓ fails for closed file descriptor #fdatasync() ✓ synchronize file state (noop) ✓ fails for closed file descriptor #link() ✓ creates a link to a file ✓ fails if dest exists ✓ fails if source is directory #symlink() ✓ creates a symbolic link to a file ✓ fails if dest exists ✓ works if source is directory #readlink() ✓ reads the symbolic link ✓ can return "buffer" encoding ✓ fails for regular files ✓ fails for directories ✓ fails for bogus paths #lstat() ✓ stats symbolic links #access() ✓ works if file exists ✓ fails in case of insufficient user permissions ✓ fails in case of insufficient group permissions ✓ fails in case of insufficient permissions ✓ fails for bogus paths FileDescriptor constructor ✓ creates a new descriptor #getPosition() ✓ returns zero by default #setPosition() ✓ updates the position #isAppend() ✓ not opened for appending (r) ✓ not opened for appending (r+) ✓ not opened for appending (rs) ✓ not opened for appending (rs+) ✓ not opened for appending (w) ✓ not opened for appending (wx) ✓ not opened for appending (w+) ✓ not opened for appending (wx+) ✓ opened for appending (a) ✓ opened for appending (ax) ✓ opened for appending (a+) ✓ opened for appending (ax+) #isTruncate() ✓ not opened for truncating (r) ✓ not opened for truncating (r+) ✓ not opened for truncating (rs) ✓ not opened for truncating (rs+) ✓ opened for truncating (w) ✓ opened for truncating (wx) ✓ opened for truncating (w+) ✓ opened for truncating (wx+) ✓ not opened for truncating (a) ✓ not opened for truncating (ax) ✓ not opened for truncating (a+) ✓ not opened for truncating (ax+) #isCreate() ✓ not opened for creation (r) ✓ not opened for creation (r+) ✓ not opened for creation (rs) ✓ not opened for creation (rs+) ✓ opened for creation (w) ✓ opened for creation (wx) ✓ opened for creation (w+) ✓ opened for creation (wx+) ✓ opened for creation (a) ✓ opened for creation (ax) ✓ opened for creation (a+) ✓ opened for creation (ax+) #isRead() ✓ opened for reading (r) ✓ opened for reading (r+) ✓ opened for reading (rs) ✓ opened for reading (rs+) ✓ not opened for reading (w) ✓ not opened for reading (wx) ✓ opened for reading (w+) ✓ opened for reading (wx+) ✓ not opened for reading (a) ✓ not opened for reading (ax) ✓ opened for reading (a+) ✓ opened for reading (ax+) #isWrite() ✓ not opened for writing (r) ✓ opened for writing (r+) ✓ not opened for writing (rs) ✓ opened for writing (rs+) ✓ opened for writing (w) ✓ opened for writing (wx) ✓ opened for writing (w+) ✓ opened for writing (wx+) ✓ opened for writing (a) ✓ opened for writing (ax) ✓ opened for writing (a+) ✓ opened for writing (ax+) #isExclusive() ✓ not opened exclusive (r) ✓ not opened exclusive (r+) ✓ not opened exclusive (rs) ✓ not opened exclusive (rs+) ✓ not opened exclusive (w) ✓ opened exclusive (wx) ✓ not opened exclusive (w+) ✓ opened exclusive (wx+) ✓ not opened exclusive (a) ✓ opened exclusive (ax) ✓ not opened exclusive (a+) ✓ opened exclusive (ax+) Directory constructor ✓ creates a named directory #addItem() ✓ allows a directory to be added ✓ allows a file to be added ✓ returns the added item #getItem() ✓ retrieves a named directory ✓ retrieves a named file ✓ returns null for missing item #removeItem() ✓ allows a directory to be removed ✓ allows a file to be removed ✓ throws if item is not a child #list() ✓ lists all items in a directory ✓ works for empty dir ✓ lists one level deep File constructor ✓ creates a named file #getContent() ✓ gets the file content ✓ is initially empty ✓ updates the atime #setContent() ✓ accepts a string ✓ accepts a buffer ✓ throws for other types ✓ updates the ctime and mtime FileSystem constructor ✓ creates a new instance ✓ accepts a createCwd option ✓ accepts a createTmp option #getRoot() ✓ gets the root directory #getItem() ✓ gets an item ✓ returns null if not found ✓ gets an item traversing links to symbolic links FileSystem.file ✓ creates a factory for files ✓ accepts a content member FileSystem.directory ✓ creates a factory for directories FileSystem.create ✓ provides a convenient way to populate a file system ✓ passes options to the FileSystem constructor ✓ accepts file factory ✓ accepts file factory with uid & gid ✓ accepts directory factory ✓ accepts directory factory with uid & gid ✓ accepts directory factory with additional items ✓ correctly generates link counts The API mock() ✓ configures the real fs module with a mock file system ✓ provides direct access to the internal filesystem object 2) creates process.cwd() and os.tmpdir() by default ✓ passes the createCwd option to the FileSystem constructor ✓ passes the createTmp option to the FileSystem constructor - uses the real fs module in require() calls mock.restore() ✓ restores bindings for the real file system mock.file() 3) lets you create files with additional properties mock.directory() 4) lets you create directories with more properties 5) works with a trailing slash 6) works without a trailing slash mock.symlink() ✓ lets you create symbolic links mock.fs() - generates a mock fs module with a mock file system - passes options to the FileSystem constructor - accepts an arbitrary nesting of files and directories Mocking the file system fs.access(path[, mode], callback) ✓ works for an accessible file ✓ works 000 (and no mode arg) ✓ works F_OK and 000 ✓ generates EACCES for R_OK and 000 ✓ generates EACCES for W_OK and 000 ✓ generates EACCES for X_OK and 000 ✓ works 111 (and no mode arg) ✓ works F_OK and 111 ✓ works X_OK and 111 ✓ generates EACCES for R_OK and 111 ✓ generates EACCES for W_OK and 111 ✓ works for 222 (and no mode arg) ✓ works F_OK and 222 ✓ works W_OK and 222 ✓ generates EACCES for R_OK and 222 ✓ generates EACCES for X_OK and 222 ✓ works for 333 (and no mode arg) ✓ works F_OK and 333 ✓ works W_OK and 333 ✓ works X_OK and 333 ✓ works X_OK | W_OK and 333 ✓ generates EACCES for R_OK and 333 ✓ works for 444 (and no mode arg) ✓ works F_OK and 444 ✓ works R_OK and 444 ✓ generates EACCES for W_OK and 444 ✓ generates EACCES for X_OK and 444 ✓ works for 555 (and no mode arg) ✓ works F_OK and 555 ✓ works R_OK and 555 ✓ works X_OK and 555 ✓ works R_OK | X_OK and 555 ✓ generates EACCES for W_OK and 555 ✓ works for 666 (and no mode arg) ✓ works F_OK and 666 ✓ works R_OK and 666 ✓ works W_OK and 666 ✓ works R_OK | W_OK and 666 ✓ generates EACCES for X_OK and 666 ✓ works for 777 (and no mode arg) ✓ works F_OK and 777 ✓ works R_OK and 777 ✓ works W_OK and 777 ✓ works X_OK and 777 ✓ works X_OK | W_OK and 777 ✓ works X_OK | R_OK and 777 ✓ works R_OK | W_OK and 777 ✓ works R_OK | W_OK | X_OK and 777 ✓ generates EACCESS for F_OK and an unreadable parent fs.accessSync(path[, mode]) ✓ works for an accessible file ✓ throws EACCESS for all but F_OK for 000 fs.rename(oldPath, newPath, callback) ✓ allows files to be renamed 7) updates mtime of parent directory ✓ calls callback with error if old path does not exist ✓ overwrites existing files ✓ allows directories to be renamed ✓ calls callback with error if new directory not empty fs.renameSync(oldPath, newPath) ✓ allows files to be renamed ✓ overwrites existing files ✓ allows directories to be renamed ✓ replaces existing directories (if empty) ✓ renames symbolic links ✓ throws if old path does not exist ✓ throws if new path basename is not directory ✓ throws if new dir is not empty dir fs.stat(path, callback) - creates an instance of fs.Stats ✓ identifies files 8) identifies directories 9) provides file stats 10) provides directory stats fs.fstat(fd, callback) 11) accepts a file descriptor for a file (r) 12) accepts a file descriptor for a directory (r) ✓ fails for bad file descriptor fs.fstatSync(fd) 13) accepts a file descriptor for a file (r) 14) accepts a file descriptor for a directory (r) ✓ fails for bad file descriptor fs.exists(path, callback) ✓ calls with true if file exists ✓ calls with true if directory exists ✓ calls with true if empty directory exists ✓ calls with true if nested directory exists ✓ calls with true if file exists ✓ calls with true if empty file exists ✓ calls with false for bogus path ✓ calls with false for bogus path (II) fs.existsSync(path) ✓ returns true if file exists ✓ returns true if directory exists ✓ returns true if empty directory exists ✓ returns true if nested directory exists ✓ returns true if file exists ✓ returns true if empty file exists ✓ returns false for bogus path ✓ returns false for bogus path (II) fs.readdirSync(path) ✓ lists directory contents ✓ lists nested directory contents ✓ throws for bogus path fs.readdir(path, callback) ✓ lists directory contents ✓ lists nested directory contents ✓ calls with an error for bogus path fs.readdirSync(path) ✓ lists directory contents ✓ lists nested directory contents ✓ throws for bogus path fs.open(path, flags, [mode], callback) ✓ opens an existing file for reading (r) ✓ fails if file does not exist (r) ✓ creates a new file for writing (w) ✓ opens an existing file for writing (w) ✓ fails if file exists (wx) fs.openSync(path, flags, [mode]) ✓ opens an existing file for reading (r) ✓ fails if file does not exist (r) ✓ creates a new file for writing (w) ✓ opens an existing file for writing (w) ✓ fails if file exists (wx) fs.close(fd, callback) ✓ closes a file descriptor ✓ fails for closed file descriptors fs.closeSync(fd) ✓ closes a file descriptor ✓ fails for closed file descriptors fs.read(fd, buffer, offset, length, position, callback) ✓ allows file contents to be read ✓ allows file contents to be read w/ offset ✓ allows file contents to be read w/ length ✓ allows file contents to be read w/ offset & length ✓ allows file contents to be read w/ position ✓ allows read w/ offset, length, & position ✓ fails for closed file descriptor ✓ fails if not open for reading fs.readSync(fd, buffer, offset, length, position) ✓ allows a file to be read synchronously ✓ allows a file to be read in two parts ✓ treats null position as current position fs.readFile(filename, [options], callback) ✓ allows a file to be read asynchronously ✓ fails for directory ✓ fails for bad path fs.readFileSync(filename, [options]) ✓ allows a file to be read synchronously ✓ fails for directory ✓ fails for bad path fs.write(fd, buffer, offset, length, position, callback) ✓ writes a buffer to a file ✓ can write a portion of a buffer to a file ✓ can append to a file ✓ fails if file not open for writing fs.writeSync(fd, buffer, offset, length, position) ✓ writes a buffer to a file ✓ can write a portion of a buffer to a file ✓ can append to a file ✓ fails if file not open for writing fs.write(fd, data[, position[, encoding]], callback) ✓ writes a string to a file ✓ can append to a file ✓ fails if file not open for writing fs.writeSync(fd, data[, position[, encoding]]) ✓ writes a string to a file ✓ can append to a file ✓ fails if file not open for writing fs.writeFile(filename, data, [options], callback) ✓ writes a string to a file 15) updates mtime of parent directory ✓ writes a buffer to a file ✓ fails if directory does not exist fs.writeFileSync(filename, data, [options] ✓ writes a string to a file ✓ writes a buffer to a file ✓ fails if directory does not exist fs.appendFile(filename, data, [options], callback) ✓ writes a string to a new file ✓ appends a string to an existing file ✓ appends a buffer to a file ✓ appends via a symbolic link file ✓ fails if directory does not exist fs.appendFileSync(filename, data, [options] ✓ writes a string to a new file ✓ appends a string to an existing file ✓ fails if directory does not exist fs.mkdir(path, [mode], callback) 16) creates a new directory 17) accepts dir mode ✓ fails if parent does not exist ✓ fails if directory already exists ✓ fails if parent is not writeable ✓ calls callback with a single argument on success ✓ calls callback with a single argument on failure fs.mkdirSync(path, [mode]) 18) creates a new directory 19) accepts dir mode ✓ fails if parent does not exist ✓ fails if directory already exists ✓ fails if file already exists ✓ fails if parent is not writeable fs.mkdtemp(prefix[, options], callback) 20) creates a new directory 21) accepts a "utf8" encoding argument 22) accepts a "buffer" encoding argument 23) accepts an options argument with "utf8" encoding 24) accepts an options argument with "buffer" encoding ✓ fails if parent does not exist ✓ fails if parent is a file ✓ fails if parent is not writeable fs.mkdtempSync(prefix[, options]) 25) creates a new directory 26) accepts a "utf8" encoding argument 27) accepts a "buffer" encoding argument 28) accepts an options argument with "utf8" encoding 29) accepts an options argument with "buffer" encoding ✓ fails if parent does not exist ✓ fails if parent is a file ✓ fails if parent is not writeable fs.rmdir(path, callback) 30) removes an empty directory ✓ fails if not empty ✓ fails if parent is not writeable fs.rmdirSync(path) ✓ removes an empty directory ✓ fails if directory does not exist ✓ fails if not empty ✓ fails if file ✓ fails if parent is not writeable fs.chown(path, uid, gid, callback) ✓ changes ownership of a file ✓ fails if file does not exist fs.chownSync(path, uid, gid) ✓ changes ownership of a file ✓ fails if file does not exist fs.fchown(fd, uid, gid, callback) ✓ changes ownership of a file fs.fchownSync(fd, uid, gid) ✓ changes ownership of a file fs.chmod(path, mode, callback) 31) changes permissions of a file ✓ fails if file does not exist fs.chmodSync(path, mode) ✓ changes permissions of a file ✓ fails if file does not exist fs.fchmod(fd, mode, callback) ✓ changes permissions of a file fs.fchmodSync(fd, mode) 32) changes permissions of a file fs.unlink(path, callback) ✓ deletes a file 33) updates mtime of parent ✓ fails for a directory ✓ respects previously opened file descriptors fs.unlinkSync(path) ✓ deletes a file ✓ respects previously opened file descriptors fs.utimes(path, atime, mtime, callback) 34) updates timestamps for a file 35) updates timestamps for a directory ✓ fails for a bogus path fs.utimesSync(path, atime, mtime) 36) updates timestamps for a file fs.futimes(fd, atime, mtime, callback) 37) updates timestamps for a file 38) updates timestamps for a directory fs.futimesSync(path, atime, mtime) 39) updates timestamps for a file fs.link(srcpath, dstpath, callback) 40) creates a link to a file ✓ works if original is renamed 41) works if original is removed ✓ fails if original is a directory fs.linkSync(srcpath, dstpath) ✓ creates a link to a file ✓ works if original is renamed ✓ works if original is removed ✓ fails if original is a directory fs.symlink(srcpath, dstpath, [type], callback) ✓ creates a symbolic link to a file ✓ breaks if original is renamed 42) works if original is a directory fs.symlinkSync(srcpath, dstpath, [type]) ✓ creates a symbolic link to a file ✓ breaks if original is renamed 43) works if original is a directory fs.readlink(path, callback) ✓ reads a symbolic link ✓ fails for regular files fs.readlinkSync(path) ✓ reads a symbolic link ✓ fails for regular files fs.lstat(path, callback) 44) stats a symbolic link 45) stats a regular file fs.lstatSync(path) 46) stats a symbolic link 47) stats a regular file fs.realpath(path, [cache], callback) 48) resolves the real path for a symbolic link ✓ resolves the real path regular file fs.createReadStream(path, [options]) ✓ creates a readable stream ✓ allows piping to a writable stream fs.createWriteStream(path[, options]) ✓ provides a write stream for a file ✓ works when write stream is corked process.cwd() ✓ maintains current working directory ✓ allows changing directory ✓ prevents changing directory to non-existent path ✓ prevents changing directory to non-directory path ✓ restores original methods on restore ✓ restores original working directory on restore security ✓ denies dir listing without execute on parent ✓ denies file read without execute on parent ✓ denies file read without read on file ✓ denies file write without write on file Item constructor ✓ creates a new instance #getATime() ✓ returns a date #setATime() ✓ sets the atime #getCTime() ✓ returns a date #setCTime() ✓ sets the ctime #getBirthtime() ✓ returns a date #setBirthtime() ✓ sets the birthtime #getMTime() ✓ returns a date #setMTime() ✓ sets the mtime #getMode() ✓ returns a number #setMode() ✓ sets the mode ✓ updates the ctime #setUid() ✓ sets the uid ✓ updates the ctime #setGid() ✓ sets the gid ✓ updates the ctime #canRead() ✓ returns true if owner and 0700 ✓ returns true if owner and 0600 ✓ returns true if owner and 0500 ✓ returns true if owner and 0400 ✓ returns false if owner and 0300 ✓ returns false if owner and 0200 ✓ returns false if owner and 0100 ✓ returns false if not owner and 0700 (different user) ✓ returns false if not owner and 0700 (different group) ✓ returns false if owner and 0170 ✓ returns true if in group and 0170 ✓ returns false if not in group and 0770 ✓ returns true if not in group and 0777 #canWrite() ✓ returns true if owner and 0700 ✓ returns true if owner and 0600 ✓ returns false if owner and 0500 ✓ returns false if owner and 0400 ✓ returns true if owner and 0300 ✓ returns true if owner and 0200 ✓ returns false if owner and 0100 ✓ returns false if not owner and 0700 (different user) ✓ returns false if not owner and 0700 (different group) ✓ returns false if owner and 0170 ✓ returns true if in group and 0170 ✓ returns false if not in group and 0770 ✓ returns true if not in group and 0777 #canExecute() ✓ returns true if owner and 0700 ✓ returns false if owner and 0600 ✓ returns true if owner and 0500 ✓ returns false if owner and 0400 ✓ returns true if owner and 0300 ✓ returns false if owner and 0200 ✓ returns true if owner and 0100 ✓ returns false if not owner and 0700 (different user) ✓ returns false if not owner and 0700 (different group) ✓ returns false if owner and 0270 ✓ returns true if in group and 0270 ✓ returns false if not in group and 0770 ✓ returns true if not in group and 0777 543 passing (527ms) 5 pending 48 failing 1) count(dir, callback) counts files in a directory: Uncaught AssertionError: expected 4 to equal 2 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/integration/filecount.spec.js:31:14 at test/integration/filecount.js:24:9 at FSReqWrap.oncomplete (fs.js:153:5) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 2) The API mock() creates process.cwd() and os.tmpdir() by default: AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:40:14) 3) The API mock.file() lets you create files with additional properties: Uncaught AssertionError: expected 1481216169000 to equal 8675309 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:124:16 at FSReqWrap.oncomplete (fs.js:153:5) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 4) The API mock.directory() lets you create directories with more properties: Uncaught AssertionError: expected true to be false at Assertion. (node_modules/chai/lib/chai/core/assertions.js:300:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isFalse (node_modules/chai/lib/chai/interface/assert.js:370:31) at test/lib/index.spec.js:150:16 at FSReqWrap.oncomplete (fs.js:153:5) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 5) The API mock.directory() works with a trailing slash: AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:168:14) 6) The API mock.directory() works without a trailing slash: AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:182:14) 7) Mocking the file system fs.rename(oldPath, newPath, callback) updates mtime of parent directory: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:649:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 8) Mocking the file system fs.stat(path, callback) identifies directories: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:806:16 at FSReqWrap.oncomplete (fs.js:153:5) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 9) Mocking the file system fs.stat(path, callback) provides file stats: Uncaught AssertionError: expected 1496519735657 to equal 1 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:818:16 at FSReqWrap.oncomplete (fs.js:153:5) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 10) Mocking the file system fs.stat(path, callback) provides directory stats: Uncaught AssertionError: expected 1 to equal 3 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:849:16 at FSReqWrap.oncomplete (fs.js:153:5) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 11) Mocking the file system fs.fstat(fd, callback) accepts a file descriptor for a file (r): Uncaught AssertionError: expected 10709 to equal 12 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:877:16 at FSReqWrap.oncomplete (fs.js:153:5) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 12) Mocking the file system fs.fstat(fd, callback) accepts a file descriptor for a directory (r): Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:890:16 at FSReqWrap.oncomplete (fs.js:153:5) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 13) Mocking the file system fs.fstatSync(fd) accepts a file descriptor for a file (r): AssertionError: expected 10709 to equal 12 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at Context. (test/lib/index.spec.js:925:14) 14) Mocking the file system fs.fstatSync(fd) accepts a file descriptor for a directory (r): AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:933:14) 15) Mocking the file system fs.writeFile(filename, data, [options], callback) updates mtime of parent directory: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:1864:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 16) Mocking the file system fs.mkdir(path, [mode], callback) creates a new directory: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:2020:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 17) Mocking the file system fs.mkdir(path, [mode], callback) accepts dir mode: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:2031:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 18) Mocking the file system fs.mkdirSync(path, [mode]) creates a new directory: AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:2089:14) 19) Mocking the file system fs.mkdirSync(path, [mode]) accepts dir mode: AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:2095:14) 20) Mocking the file system fs.mkdtemp(prefix[, options], callback) creates a new directory: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:2146:18 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 21) Mocking the file system fs.mkdtemp(prefix[, options], callback) accepts a "utf8" encoding argument: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:2160:18 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 22) Mocking the file system fs.mkdtemp(prefix[, options], callback) accepts a "buffer" encoding argument: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:2175:18 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 23) Mocking the file system fs.mkdtemp(prefix[, options], callback) accepts an options argument with "utf8" encoding: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:2189:18 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 24) Mocking the file system fs.mkdtemp(prefix[, options], callback) accepts an options argument with "buffer" encoding: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:2204:18 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 25) Mocking the file system fs.mkdtempSync(prefix[, options]) creates a new directory: AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:2269:16) 26) Mocking the file system fs.mkdtempSync(prefix[, options]) accepts a "utf8" encoding argument: AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:2278:16) 27) Mocking the file system fs.mkdtempSync(prefix[, options]) accepts a "buffer" encoding argument: AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:2288:16) 28) Mocking the file system fs.mkdtempSync(prefix[, options]) accepts an options argument with "utf8" encoding: AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:2297:16) 29) Mocking the file system fs.mkdtempSync(prefix[, options]) accepts an options argument with "buffer" encoding: AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:2307:16) 30) Mocking the file system fs.rmdir(path, callback) removes an empty directory: AssertionError: expected 1 to equal 3 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at Context. (test/lib/index.spec.js:2343:14) 31) Mocking the file system fs.chmod(path, mode, callback) changes permissions of a file: Uncaught AssertionError: expected 420 to equal 436 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:2509:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 32) Mocking the file system fs.fchmodSync(fd, mode) changes permissions of a file: AssertionError: expected 420 to equal 292 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at Context. (test/lib/index.spec.js:2582:14) 33) Mocking the file system fs.unlink(path, callback) updates mtime of parent: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:2619:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 34) Mocking the file system fs.utimes(path, atime, mtime, callback) updates timestamps for a file: Uncaught AssertionError: expected 1496521432256 to equal 100 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:2693:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 35) Mocking the file system fs.utimes(path, atime, mtime, callback) updates timestamps for a directory: Uncaught AssertionError: expected 1496521432256 to equal 300 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:2705:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 36) Mocking the file system fs.utimesSync(path, atime, mtime) updates timestamps for a file: AssertionError: expected 1496521432256 to equal 100 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at Context. (test/lib/index.spec.js:2732:14) 37) Mocking the file system fs.futimes(fd, atime, mtime, callback) updates timestamps for a file: Uncaught AssertionError: expected 1496521432256 to equal 100 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:2755:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 38) Mocking the file system fs.futimes(fd, atime, mtime, callback) updates timestamps for a directory: Uncaught AssertionError: expected 1496521432256 to equal 300 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:2768:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 39) Mocking the file system fs.futimesSync(path, atime, mtime) updates timestamps for a file: AssertionError: expected 1496521432256 to equal 100 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at Context. (test/lib/index.spec.js:2789:14) 40) Mocking the file system fs.link(srcpath, dstpath, callback) creates a link to a file: Uncaught AssertionError: expected 1 to equal 2 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:2813:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 41) Mocking the file system fs.link(srcpath, dstpath, callback) works if original is removed: Uncaught AssertionError: expected 1 to equal 2 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:2839:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 42) Mocking the file system fs.symlink(srcpath, dstpath, [type], callback) works if original is a directory: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:2933:16 at FSReqWrap.oncomplete (fs.js:135:15) at lib/binding.js:37:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 43) Mocking the file system fs.symlinkSync(srcpath, dstpath, [type]) works if original is a directory: AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:2965:14) 44) Mocking the file system fs.lstat(path, callback) stats a symbolic link: Uncaught AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at test/lib/index.spec.js:3042:16 at FSReqWrap.oncomplete (fs.js:153:5) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 45) Mocking the file system fs.lstat(path, callback) stats a regular file: Uncaught AssertionError: expected 1481216169000 to equal 1 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:3056:16 at FSReqWrap.oncomplete (fs.js:153:5) at lib/binding.js:39:9 at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9) 46) Mocking the file system fs.lstatSync(path) stats a symbolic link: AssertionError: expected false to be true at Assertion. (node_modules/chai/lib/chai/core/assertions.js:278:10) at Assertion.addProperty (node_modules/chai/lib/chai/utils/addProperty.js:43:29) at Function.assert.isTrue (node_modules/chai/lib/chai/interface/assert.js:332:31) at Context. (test/lib/index.spec.js:3081:14) 47) Mocking the file system fs.lstatSync(path) stats a regular file: AssertionError: expected 1481216169000 to equal 1 at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at Context. (test/lib/index.spec.js:3090:14) 48) Mocking the file system fs.realpath(path, [cache], callback) resolves the real path for a symbolic link: Uncaught AssertionError: expected '/home/agrzes/git/image-organizer/node_modules/mock-fs/link' to equal '/home/agrzes/git/image-organizer/node_modules/mock-fs/dir/file.txt' at Function.assert.equal (node_modules/chai/lib/chai/interface/assert.js:126:10) at test/lib/index.spec.js:3113:16 at LOOP (fs.js:1742:14) at _combinedTickCallback (internal/process/next_tick.js:95:7) at process._tickCallback (internal/process/next_tick.js:161:9)