Skip to content

Commit 9249d9b

Browse files
authored
Merge pull request #7 from scalvert/update-readme-generator
2 parents 3f35b77 + 5af89e8 commit 9249d9b

File tree

6 files changed

+9696
-5931
lines changed

6 files changed

+9696
-5931
lines changed

.eslintrc.cjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ module.exports = {
3838
allowModules: ['vite', 'vitest'],
3939
},
4040
],
41+
'jsdoc/no-undefined-types': 'off',
4142
},
4243
overrides: [
4344
{

README.md

Lines changed: 121 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -69,31 +69,124 @@ describe('Some tests', () => {
6969

7070
## API
7171

72-
```ts
73-
class BinTesterProject extends Project {
74-
private _dirChanged;
75-
constructor(name: string, version?: string, cb?: (project: Project) => void);
76-
gitInit(): execa.ExecaChildProcess<string>;
77-
chdir(): void;
78-
dispose(): void;
79-
}
80-
81-
interface BinTesterOptions {
82-
binPath: string;
83-
projectConstructor?: any;
84-
}
85-
86-
interface RunOptions {
87-
args?: string[];
88-
execaOptions?: execa.Options<string>;
89-
}
90-
91-
interface createBinTesterResult<TProject extends BinTesterProject> {
92-
runBin: (runOptions?: RunOptions) => execa.ExecaChildProcess<string>;
93-
setupProject: () => Promise<TProject>;
94-
setupTmpDir: () => Promise<string>;
95-
teardownProject: () => void;
96-
}
97-
98-
function createBinTester<TProject extends BinTesterProject>(options: BinTesterOptions): createBinTesterResult<TProject>;
99-
```
72+
<!--DOCS_START-->
73+
## Classes
74+
75+
<dl>
76+
<dt><a href="#BinTesterProject">BinTesterProject</a></dt>
77+
<dd></dd>
78+
</dl>
79+
80+
## Functions
81+
82+
<dl>
83+
<dt><a href="#createBinTester">createBinTester(options)</a> ⇒ <code>CreateBinTesterResult.&lt;TProject&gt;</code></dt>
84+
<dd><p>Creates the bin tester API functions to use within tests.</p></dd>
85+
</dl>
86+
87+
<a name="BinTesterProject"></a>
88+
89+
## BinTesterProject
90+
**Kind**: global class
91+
92+
* [BinTesterProject](#BinTesterProject)
93+
* [new BinTesterProject(name, version, cb)](#new_BinTesterProject_new)
94+
* [.gitInit()](#BinTesterProject+gitInit) ⇒ <code>\*</code>
95+
* [.chdir()](#BinTesterProject+chdir)
96+
* [.writeJSON(dirJSON)](#BinTesterProject+writeJSON) ⇒ <code>\*</code>
97+
* [.dispose()](#BinTesterProject+dispose) ⇒ <code>void</code>
98+
99+
<a name="new_BinTesterProject_new"></a>
100+
101+
### new BinTesterProject(name, version, cb)
102+
<p>Constructs an instance of a BinTesterProject.</p>
103+
104+
105+
| Param | Type | Default | Description |
106+
| --- | --- | --- | --- |
107+
| name | <code>string</code> | <code>&quot;fake-project&quot;</code> | <p>The name of the project. Used within the package.json as the name property.</p> |
108+
| version | <code>string</code> | | <p>The version of the project. Used within the package.json as the version property.</p> |
109+
| cb | <code>function</code> | | <p>An optional callback for additional setup steps after the project is constructed.</p> |
110+
111+
<a name="BinTesterProject+gitInit"></a>
112+
113+
### binTesterProject.gitInit() ⇒ <code>\*</code>
114+
<p>Runs <code>git init</code> inside a project.</p>
115+
116+
**Kind**: instance method of [<code>BinTesterProject</code>](#BinTesterProject)
117+
**Returns**: <code>\*</code> - <p>{execa.ExecaChildProcess<string>}</p>
118+
<a name="BinTesterProject+chdir"></a>
119+
120+
### binTesterProject.chdir()
121+
<p>Changes a directory from inside the project.</p>
122+
123+
**Kind**: instance method of [<code>BinTesterProject</code>](#BinTesterProject)
124+
<a name="BinTesterProject+writeJSON"></a>
125+
126+
### binTesterProject.writeJSON(dirJSON) ⇒ <code>\*</code>
127+
<p>Writes a directory struture in the project directory.</p>
128+
129+
**Kind**: instance method of [<code>BinTesterProject</code>](#BinTesterProject)
130+
**Returns**: <code>\*</code> - <p>{Promise<void>}</p>
131+
132+
| Param | Type | Description |
133+
| --- | --- | --- |
134+
| dirJSON | <code>fixturify.DirJSON</code> | <p>A JSON object representing the directory structure to create.</p> |
135+
136+
<a name="BinTesterProject+dispose"></a>
137+
138+
### binTesterProject.dispose() ⇒ <code>void</code>
139+
<p>Correctly disposes of the project, observing when the directory has been changed.</p>
140+
141+
**Kind**: instance method of [<code>BinTesterProject</code>](#BinTesterProject)
142+
<a name="createBinTester"></a>
143+
144+
## createBinTester(options) ⇒ <code>CreateBinTesterResult.&lt;TProject&gt;</code>
145+
<p>Creates the bin tester API functions to use within tests.</p>
146+
147+
**Kind**: global function
148+
**Returns**: <code>CreateBinTesterResult.&lt;TProject&gt;</code> - <ul>
149+
<li>A project instance.</li>
150+
</ul>
151+
152+
| Param | Type | Description |
153+
| --- | --- | --- |
154+
| options | <code>BinTesterOptions.&lt;TProject&gt;</code> | <p>An object of bin tester options</p> |
155+
156+
157+
* [createBinTester(options)](#createBinTester) ⇒ <code>CreateBinTesterResult.&lt;TProject&gt;</code>
158+
* [~runBin(...args)](#createBinTester..runBin) ⇒ <code>execa.ExecaChildProcess.&lt;string&gt;</code>
159+
* [~setupProject()](#createBinTester..setupProject)
160+
* [~setupTmpDir()](#createBinTester..setupTmpDir)
161+
* [~teardownProject()](#createBinTester..teardownProject)
162+
163+
<a name="createBinTester..runBin"></a>
164+
165+
### createBinTester~runBin(...args) ⇒ <code>execa.ExecaChildProcess.&lt;string&gt;</code>
166+
**Kind**: inner method of [<code>createBinTester</code>](#createBinTester)
167+
**Returns**: <code>execa.ExecaChildProcess.&lt;string&gt;</code> - <p>An instance of execa's child process.</p>
168+
169+
| Param | Type | Description |
170+
| --- | --- | --- |
171+
| ...args | <code>RunBinArgs</code> | <p>Arguments or execa options.</p> |
172+
173+
<a name="createBinTester..setupProject"></a>
174+
175+
### createBinTester~setupProject()
176+
<p>Sets up the specified project for use within tests.</p>
177+
178+
**Kind**: inner method of [<code>createBinTester</code>](#createBinTester)
179+
<a name="createBinTester..setupTmpDir"></a>
180+
181+
### createBinTester~setupTmpDir()
182+
<p>Sets up a tmp directory for use within tests.</p>
183+
184+
**Kind**: inner method of [<code>createBinTester</code>](#createBinTester)
185+
<a name="createBinTester..teardownProject"></a>
186+
187+
### createBinTester~teardownProject()
188+
<p>Tears the project down, ensuring the tmp directory is removed. Shoud be paired with setupProject.</p>
189+
190+
**Kind**: inner method of [<code>createBinTester</code>](#createBinTester)
191+
192+
<!--DOCS_END-->

0 commit comments

Comments
 (0)