From 24ac47eacce9fc1c1204638e4ef56e01e3cba9a3 Mon Sep 17 00:00:00 2001 From: tkqubo Date: Tue, 26 Jan 2016 20:41:14 +0900 Subject: [PATCH 1/2] mock-fs 3.6.0 --- mock-fs/mock-fs-tests.ts | 7 +++++++ mock-fs/mock-fs.d.ts | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/mock-fs/mock-fs-tests.ts b/mock-fs/mock-fs-tests.ts index d4c5eae4f..ef628ce58 100644 --- a/mock-fs/mock-fs-tests.ts +++ b/mock-fs/mock-fs-tests.ts @@ -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 +}); diff --git a/mock-fs/mock-fs.d.ts b/mock-fs/mock-fs.d.ts index 539e74e86..fb37173b2 100644 --- a/mock-fs/mock-fs.d.ts +++ b/mock-fs/mock-fs.d.ts @@ -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 // 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 { From 5713fd77ebb3a57a93b3bfd265bba55778c6371a Mon Sep 17 00:00:00 2001 From: tkqubo Date: Wed, 27 Jan 2016 13:19:08 +0900 Subject: [PATCH 2/2] chore: add my name on definition --- mock-fs/mock-fs.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mock-fs/mock-fs.d.ts b/mock-fs/mock-fs.d.ts index fb37173b2..6178d762d 100644 --- a/mock-fs/mock-fs.d.ts +++ b/mock-fs/mock-fs.d.ts @@ -1,6 +1,6 @@ // Type definitions for mock-fs 3.6.0 // Project: https://github.com/tschaub/mock-fs -// Definitions by: Wim Looman +// Definitions by: Wim Looman , Qubo // Definitions: https://github.com/borisyankov/DefinitelyTyped ///