Merge pull request #7803 from tkqubo/update-mock-fs

Update mock-fs to 3.6.0
This commit is contained in:
Masahiro Wakame
2016-01-29 12:44:34 +09:00
2 changed files with 17 additions and 4 deletions

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
});

14
mock-fs/mock-fs.d.ts vendored
View File

@@ -1,6 +1,6 @@
// 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 by: Wim Looman <https://github.com/Nemo157>, Qubo <https://github.com/tkqubo>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../node/node.d.ts" />
@@ -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 {