@scalvert/bin-tester 0.3.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -47,15 +47,15 @@ describe('Some tests', () => {
47
47
  });
48
48
 
49
49
  // Run the bin and do something with the result
50
- test('a test', () => {
50
+ test('a test', async () => {
51
51
  const result = await runBin();
52
52
 
53
53
  expect(result.stdout).toBe('Did some stuff');
54
54
  });
55
55
 
56
- test('another test', () => {
56
+ test('another test', async () => {
57
57
  // Write a file with contents to the tmp directory
58
- await project.writeJSON({
58
+ await project.writeDirJSON({
59
59
  'some/file.txt': 'some content',
60
60
  });
61
61
 
@@ -93,7 +93,7 @@ describe('Some tests', () => {
93
93
  * [new BinTesterProject(name, version, cb)](#new_BinTesterProject_new)
94
94
  * [.gitInit()](#BinTesterProject+gitInit) ⇒ <code>\*</code>
95
95
  * [.chdir()](#BinTesterProject+chdir)
96
- * [.writeJSON(dirJSON)](#BinTesterProject+writeJSON) ⇒ <code>\*</code>
96
+ * [.writeDirJSON(dirJSON)](#BinTesterProject+writeDirJSON) ⇒ <code>\*</code>
97
97
  * [.dispose()](#BinTesterProject+dispose) ⇒ <code>void</code>
98
98
 
99
99
  <a name="new_BinTesterProject_new"></a>
@@ -121,9 +121,9 @@ describe('Some tests', () => {
121
121
  <p>Changes a directory from inside the project.</p>
122
122
 
123
123
  **Kind**: instance method of [<code>BinTesterProject</code>](#BinTesterProject)
124
- <a name="BinTesterProject+writeJSON"></a>
124
+ <a name="BinTesterProject+writeDirJSON"></a>
125
125
 
126
- ### binTesterProject.writeJSON(dirJSON) ⇒ <code>\*</code>
126
+ ### binTesterProject.writeDirJSON(dirJSON) ⇒ <code>\*</code>
127
127
  <p>Writes a directory struture in the project directory.</p>
128
128
 
129
129
  **Kind**: instance method of [<code>BinTesterProject</code>](#BinTesterProject)
package/dist/index.cjs CHANGED
@@ -73,7 +73,7 @@ var BinTesterProject = class extends import_fixturify_project.Project {
73
73
  await this.write();
74
74
  process.chdir(this.baseDir);
75
75
  }
76
- writeJSON(dirJSON) {
76
+ writeDirJSON(dirJSON) {
77
77
  this.files = (0, import_deepmerge.default)(this.files, dirJSON);
78
78
  return this.write();
79
79
  }
package/dist/index.d.ts CHANGED
@@ -28,7 +28,7 @@ declare class BinTesterProject extends Project {
28
28
  * @param {fixturify.DirJSON} dirJSON - A JSON object representing the directory structure to create.
29
29
  * @returns {*} {Promise<void>}
30
30
  */
31
- writeJSON(dirJSON: fixturify.DirJSON): Promise<void>;
31
+ writeDirJSON(dirJSON: fixturify.DirJSON): Promise<void>;
32
32
  /**
33
33
  * Correctly disposes of the project, observing when the directory has been changed.
34
34
  *
@@ -49,7 +49,7 @@ interface BinTesterOptions<TProject> {
49
49
  /**
50
50
  * An optional function to use to create the project. Use this if you want to provide a custom implementation of a BinTesterProject.
51
51
  */
52
- createProject?: () => TProject;
52
+ createProject?: () => Promise<TProject>;
53
53
  }
54
54
  interface RunBin {
55
55
  /**
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ var BinTesterProject = class extends Project {
41
41
  await this.write();
42
42
  process.chdir(this.baseDir);
43
43
  }
44
- writeJSON(dirJSON) {
44
+ writeDirJSON(dirJSON) {
45
45
  this.files = deepmerge(this.files, dirJSON);
46
46
  return this.write();
47
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalvert/bin-tester",
3
- "version": "0.3.0",
3
+ "version": "1.0.0",
4
4
  "description": "A test harness to invoke a CLI in a tmp directory",
5
5
  "keywords": [
6
6
  "cli",