@heroku/heroku-cli-util 9.0.0-beta.1 → 9.0.0-beta.2
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/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { initCliTest } from './test-helpers/init';
|
|
2
|
+
import { restoreStdoutStderr, setupStdoutStderr, stderr, stdout } from './test-helpers/stub-output';
|
|
3
|
+
export declare const testHelpers: {
|
|
4
|
+
expectOutput: (actual: string, expected: string) => Chai.Assertion;
|
|
5
|
+
initCliTest: typeof initCliTest;
|
|
6
|
+
restoreStdoutStderr: typeof restoreStdoutStderr;
|
|
7
|
+
setupStdoutStderr: typeof setupStdoutStderr;
|
|
8
|
+
stderr: typeof stderr;
|
|
9
|
+
stdout: typeof stdout;
|
|
10
|
+
};
|
|
1
11
|
export { default as expectOutput } from './test-helpers/expect-output';
|
|
2
|
-
export * from './test-helpers/init';
|
|
3
|
-
export * from './test-helpers/stub-output';
|
|
4
12
|
export * from './types/errors/ambiguous';
|
|
5
13
|
export * from './types/errors/not-found';
|
|
6
14
|
export * from './types/pg/data-api';
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPgHost = exports.expectOutput = void 0;
|
|
3
|
+
exports.getPgHost = exports.expectOutput = exports.testHelpers = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
// Test helpers (optional, for test environments)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
const expect_output_1 = require("./test-helpers/expect-output");
|
|
7
|
+
const init_1 = require("./test-helpers/init");
|
|
8
|
+
const stub_output_1 = require("./test-helpers/stub-output");
|
|
9
|
+
exports.testHelpers = {
|
|
10
|
+
expectOutput: expect_output_1.default,
|
|
11
|
+
initCliTest: init_1.initCliTest,
|
|
12
|
+
restoreStdoutStderr: stub_output_1.restoreStdoutStderr,
|
|
13
|
+
setupStdoutStderr: stub_output_1.setupStdoutStderr,
|
|
14
|
+
stderr: stub_output_1.stderr,
|
|
15
|
+
stdout: stub_output_1.stdout,
|
|
16
|
+
};
|
|
17
|
+
var expect_output_2 = require("./test-helpers/expect-output");
|
|
18
|
+
Object.defineProperty(exports, "expectOutput", { enumerable: true, get: function () { return expect_output_2.default; } });
|
|
10
19
|
// Types - Errors
|
|
11
20
|
tslib_1.__exportStar(require("./types/errors/ambiguous"), exports);
|
|
12
21
|
tslib_1.__exportStar(require("./types/errors/not-found"), exports);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupStdoutStderr = setupStdoutStderr;
|
|
4
|
+
exports.restoreStdoutStderr = restoreStdoutStderr;
|
|
3
5
|
exports.stdout = stdout;
|
|
4
6
|
exports.stderr = stderr;
|
|
5
7
|
const sinon = require("sinon");
|
|
@@ -7,7 +9,7 @@ let stdoutWriteStub;
|
|
|
7
9
|
let stdoutOutput = '';
|
|
8
10
|
let stderrWriteStub;
|
|
9
11
|
let stderrOutput = '';
|
|
10
|
-
|
|
12
|
+
function setupStdoutStderr() {
|
|
11
13
|
stdoutOutput = '';
|
|
12
14
|
stdoutWriteStub = sinon.stub(process.stdout, 'write').callsFake((str) => {
|
|
13
15
|
stdoutOutput += str.toString();
|
|
@@ -18,13 +20,13 @@ beforeEach(function () {
|
|
|
18
20
|
stderrOutput += str.toString();
|
|
19
21
|
return true;
|
|
20
22
|
});
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
+
}
|
|
24
|
+
function restoreStdoutStderr() {
|
|
23
25
|
stdoutWriteStub.restore();
|
|
24
26
|
stdoutOutput = '';
|
|
25
27
|
stderrWriteStub.restore();
|
|
26
28
|
stderrOutput = '';
|
|
27
|
-
}
|
|
29
|
+
}
|
|
28
30
|
function stdout() {
|
|
29
31
|
return stdoutOutput;
|
|
30
32
|
}
|