diff --git a/README.md b/README.md index c52c09c..eaabafb 100644 --- a/README.md +++ b/README.md @@ -47,15 +47,15 @@ describe('Some tests', () => { }); // Run the bin and do something with the result - test('a test', () => { + test('a test', async () => { const result = await runBin(); expect(result.stdout).toBe('Did some stuff'); }); - test('another test', () => { + test('another test', async () => { // Write a file with contents to the tmp directory - await project.writeJSON({ + await project.writeDirJSON({ 'some/file.txt': 'some content', }); @@ -93,7 +93,7 @@ describe('Some tests', () => { * [new BinTesterProject(name, version, cb)](#new_BinTesterProject_new) * [.gitInit()](#BinTesterProject+gitInit) ⇒ \* * [.chdir()](#BinTesterProject+chdir) - * [.writeJSON(dirJSON)](#BinTesterProject+writeJSON) ⇒ \* + * [.writeDirJSON(dirJSON)](#BinTesterProject+writeDirJSON) ⇒ \* * [.dispose()](#BinTesterProject+dispose) ⇒ void @@ -121,9 +121,9 @@ describe('Some tests', () => {

Changes a directory from inside the project.

**Kind**: instance method of [BinTesterProject](#BinTesterProject) - + -### binTesterProject.writeJSON(dirJSON) ⇒ \* +### binTesterProject.writeDirJSON(dirJSON) ⇒ \*

Writes a directory struture in the project directory.

**Kind**: instance method of [BinTesterProject](#BinTesterProject) diff --git a/src/create-bin-tester.ts b/src/create-bin-tester.ts index 4048090..460390b 100644 --- a/src/create-bin-tester.ts +++ b/src/create-bin-tester.ts @@ -12,7 +12,7 @@ interface BinTesterOptions { /** * An optional function to use to create the project. Use this if you want to provide a custom implementation of a BinTesterProject. */ - createProject?: () => TProject; + createProject?: () => Promise; } interface RunOptions { diff --git a/src/project.ts b/src/project.ts index dbb3863..1502256 100644 --- a/src/project.ts +++ b/src/project.ts @@ -51,7 +51,7 @@ export default class BinTesterProject extends Project { * @param {fixturify.DirJSON} dirJSON - A JSON object representing the directory structure to create. * @returns {*} {Promise} */ - writeJSON(dirJSON: fixturify.DirJSON): Promise { + writeDirJSON(dirJSON: fixturify.DirJSON): Promise { this.files = deepmerge(this.files, dirJSON); return this.write();