@inquirer/testing 1.0.0 → 1.0.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/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/cjs/index.js +1 -12
- package/dist/cjs/types/index.d.mts +0 -1
- package/dist/esm/index.mjs +0 -10
- package/dist/esm/types/index.d.mts +0 -1
- package/package.json +4 -4
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -57,5 +57,5 @@ You can refer to [the `@inquirer/input` prompt test suite](https://github.com/SB
|
|
|
57
57
|
|
|
58
58
|
# License
|
|
59
59
|
|
|
60
|
-
Copyright (c)
|
|
60
|
+
Copyright (c) 2023 Simon Boudrias (twitter: [@vaxilart](https://twitter.com/Vaxilart))<br/>
|
|
61
61
|
Licensed under the MIT license.
|
package/dist/cjs/index.js
CHANGED
|
@@ -18,11 +18,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
18
18
|
};
|
|
19
19
|
var _BufferedStream__chunks;
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.render =
|
|
21
|
+
exports.render = void 0;
|
|
22
22
|
const mute_stream_1 = __importDefault(require("mute-stream"));
|
|
23
23
|
const strip_ansi_1 = __importDefault(require("strip-ansi"));
|
|
24
24
|
const node_stream_1 = require("node:stream");
|
|
25
|
-
const logStore = [];
|
|
26
25
|
class BufferedStream extends node_stream_1.Stream.Writable {
|
|
27
26
|
constructor() {
|
|
28
27
|
super(...arguments);
|
|
@@ -44,16 +43,6 @@ class BufferedStream extends node_stream_1.Stream.Writable {
|
|
|
44
43
|
}
|
|
45
44
|
}
|
|
46
45
|
_BufferedStream__chunks = new WeakMap();
|
|
47
|
-
beforeEach(() => {
|
|
48
|
-
logStore.length = 0;
|
|
49
|
-
});
|
|
50
|
-
afterEach(() => {
|
|
51
|
-
logStore.forEach((...line) => console.log(...line));
|
|
52
|
-
});
|
|
53
|
-
function log(...line) {
|
|
54
|
-
logStore.push(line);
|
|
55
|
-
}
|
|
56
|
-
exports.log = log;
|
|
57
46
|
function render(prompt, props, options) {
|
|
58
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
59
48
|
const input = new mute_stream_1.default();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import MuteStream from 'mute-stream';
|
|
2
2
|
import type { Prompt } from '@inquirer/type';
|
|
3
|
-
export declare function log(...line: Parameters<typeof console.log>): void;
|
|
4
3
|
export declare function render<TestedPrompt extends Prompt<any, any>>(prompt: TestedPrompt, props: Parameters<TestedPrompt>[0], options?: Parameters<TestedPrompt>[1]): Promise<{
|
|
5
4
|
answer: Promise<any>;
|
|
6
5
|
input: MuteStream;
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import MuteStream from 'mute-stream';
|
|
2
2
|
import stripAnsi from 'strip-ansi';
|
|
3
3
|
import { Stream } from 'node:stream';
|
|
4
|
-
const logStore = [];
|
|
5
4
|
class BufferedStream extends Stream.Writable {
|
|
6
5
|
#_chunks = [];
|
|
7
6
|
_write(chunk, _encoding, callback) {
|
|
@@ -19,15 +18,6 @@ class BufferedStream extends Stream.Writable {
|
|
|
19
18
|
return lastChunk ?? '';
|
|
20
19
|
}
|
|
21
20
|
}
|
|
22
|
-
beforeEach(() => {
|
|
23
|
-
logStore.length = 0;
|
|
24
|
-
});
|
|
25
|
-
afterEach(() => {
|
|
26
|
-
logStore.forEach((...line) => console.log(...line));
|
|
27
|
-
});
|
|
28
|
-
export function log(...line) {
|
|
29
|
-
logStore.push(line);
|
|
30
|
-
}
|
|
31
21
|
export async function render(prompt, props, options) {
|
|
32
22
|
const input = new MuteStream();
|
|
33
23
|
input.unmute();
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import MuteStream from 'mute-stream';
|
|
2
2
|
import type { Prompt } from '@inquirer/type';
|
|
3
|
-
export declare function log(...line: Parameters<typeof console.log>): void;
|
|
4
3
|
export declare function render<TestedPrompt extends Prompt<any, any>>(prompt: TestedPrompt, props: Parameters<TestedPrompt>[0], options?: Parameters<TestedPrompt>[1]): Promise<{
|
|
5
4
|
answer: Promise<any>;
|
|
6
5
|
input: MuteStream;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inquirer/testing",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=14.18.0"
|
|
6
6
|
},
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"license": "MIT",
|
|
61
61
|
"homepage": "https://github.com/SBoudrias/Inquirer.js/blob/master/packages/testing/README.md",
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"@inquirer/type": "^1.0.
|
|
63
|
+
"@inquirer/type": "^1.0.2",
|
|
64
64
|
"mute-stream": "^1.0.0",
|
|
65
65
|
"strip-ansi": "^7.0.1"
|
|
66
66
|
},
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"clean": "rm -rf dist",
|
|
70
70
|
"tsc:esm": "tsc -p ./tsconfig.esm.json",
|
|
71
71
|
"tsc:cjs": "tsc -p ./tsconfig.cjs.json && yarn run fix-ext",
|
|
72
|
-
"fix-ext": "ts-node ../../tools/rename-ext.
|
|
72
|
+
"fix-ext": "node --no-warnings=ExperimentalWarning --loader ts-node/esm ../../tools/rename-ext.mts"
|
|
73
73
|
},
|
|
74
74
|
"exports": {
|
|
75
75
|
".": {
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "865c589ffbc4a66f328dc4e64a08646200c755f3"
|
|
87
87
|
}
|