mock-fs 3.6.0

This commit is contained in:
tkqubo
2016-01-26 20:41:14 +09:00
parent 46719185c5
commit 24ac47eacc
2 changed files with 16 additions and 3 deletions
+7
View File
@@ -77,3 +77,10 @@ var mockedFS = mock.fs({
if (mockedFS.readFileSync('/file', { encoding: 'utf8' }) === 'blah') {
console.log('woo');
}
mock({
'path/to/file.txt': 'file content here'
}, {
createTmp: true,
createCwd: false
});
+9 -3
View File
@@ -1,4 +1,4 @@
// Type definitions for mock-fs 2.5.0
// Type definitions for mock-fs 3.6.0
// Project: https://github.com/tschaub/mock-fs
// Definitions by: Wim Looman <https://github.com/Nemo157>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -8,7 +8,7 @@
declare module "mock-fs" {
import fs = require("fs");
function mock(config?: mock.Config): void;
function mock(config?: mock.Config, options?: mock.Options): void;
module mock {
function file(config: FileConfig): File;
@@ -17,12 +17,17 @@ declare module "mock-fs" {
function restore(): void;
function fs(config?: Config): typeof fs;
function fs(config?: Config, options?: Options): typeof fs;
interface Config {
[path: string]: string | Buffer | File | Directory | Symlink | Config;
}
interface Options {
createCwd?: boolean;
createTmp?: boolean;
}
interface CommonConfig {
mode?: number;
uid?: number;
@@ -30,6 +35,7 @@ declare module "mock-fs" {
atime?: Date;
ctime?: Date;
mtime?: Date;
birthtime?: Date;
}
interface FileConfig extends CommonConfig {