@@ -69,31 +69,124 @@ describe('Some tests', () => {
69
69
70
70
## API
71
71
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.< ; TProject> ; </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 >" ; fake-project" ; </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.< ; TProject> ; </code >
145
+ <p >Creates the bin tester API functions to use within tests.</p >
146
+
147
+ ** Kind** : global function
148
+ ** Returns** : <code >CreateBinTesterResult.< ; TProject> ; </code > - <ul >
149
+ <li >A project instance.</li >
150
+ </ul >
151
+
152
+ | Param | Type | Description |
153
+ | --- | --- | --- |
154
+ | options | <code >BinTesterOptions.< ; TProject> ; </code > | <p >An object of bin tester options</p > |
155
+
156
+
157
+ * [ createBinTester(options)] ( #createBinTester ) ⇒ <code >CreateBinTesterResult.< ; TProject> ; </code >
158
+ * [ ~ runBin(...args)] ( #createBinTester..runBin ) ⇒ <code >execa.ExecaChildProcess.< ; string> ; </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.< ; string> ; </code >
166
+ ** Kind** : inner method of [ <code >createBinTester</code >] ( #createBinTester )
167
+ ** Returns** : <code >execa.ExecaChildProcess.< ; string> ; </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