Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});

Expand Down Expand Up @@ -93,7 +93,7 @@ describe('Some tests', () => {
* [new BinTesterProject(name, version, cb)](#new_BinTesterProject_new)
* [.gitInit()](#BinTesterProject+gitInit) ⇒ <code>\*</code>
* [.chdir()](#BinTesterProject+chdir)
* [.writeJSON(dirJSON)](#BinTesterProject+writeJSON) ⇒ <code>\*</code>
* [.writeDirJSON(dirJSON)](#BinTesterProject+writeDirJSON) ⇒ <code>\*</code>
* [.dispose()](#BinTesterProject+dispose) ⇒ <code>void</code>

<a name="new_BinTesterProject_new"></a>
Expand Down Expand Up @@ -121,9 +121,9 @@ describe('Some tests', () => {
<p>Changes a directory from inside the project.</p>

**Kind**: instance method of [<code>BinTesterProject</code>](#BinTesterProject)
<a name="BinTesterProject+writeJSON"></a>
<a name="BinTesterProject+writeDirJSON"></a>

### binTesterProject.writeJSON(dirJSON) ⇒ <code>\*</code>
### binTesterProject.writeDirJSON(dirJSON) ⇒ <code>\*</code>
<p>Writes a directory struture in the project directory.</p>

**Kind**: instance method of [<code>BinTesterProject</code>](#BinTesterProject)
Expand Down
2 changes: 1 addition & 1 deletion src/create-bin-tester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface BinTesterOptions<TProject> {
/**
* 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<TProject>;
}

interface RunOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void>}
*/
writeJSON(dirJSON: fixturify.DirJSON): Promise<void> {
writeDirJSON(dirJSON: fixturify.DirJSON): Promise<void> {
this.files = deepmerge(this.files, dirJSON);

return this.write();
Expand Down