@inquirer/testing 2.1.48 → 2.1.50

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.
@@ -7,8 +7,6 @@ exports.render = render;
7
7
  const node_stream_1 = require("node:stream");
8
8
  const node_util_1 = require("node:util");
9
9
  const mute_stream_1 = __importDefault(require("mute-stream"));
10
- const ansi_escapes_1 = __importDefault(require("ansi-escapes"));
11
- const ignoredAnsi = new Set([ansi_escapes_1.default.cursorHide, ansi_escapes_1.default.cursorShow]);
12
10
  class BufferedStream extends node_stream_1.Stream.Writable {
13
11
  #_fullOutput = '';
14
12
  #_chunks = [];
@@ -16,11 +14,8 @@ class BufferedStream extends node_stream_1.Stream.Writable {
16
14
  _write(chunk, _encoding, callback) {
17
15
  const str = chunk.toString();
18
16
  this.#_fullOutput += str;
19
- // There's some ANSI Inquirer just send to keep state of the terminal clear; we'll ignore those since they're
20
- // unlikely to be used by end users or part of prompt code.
21
- if (!ignoredAnsi.has(str)) {
22
- this.#_rawChunks.push(str);
23
- }
17
+ // Keep track of every chunk send through.
18
+ this.#_rawChunks.push(str);
24
19
  // Stripping the ANSI codes here because Inquirer will push commands ANSI (like cursor move.)
25
20
  // This is probably fine since we don't care about those for testing; but this could become
26
21
  // an issue if we ever want to test for those.
package/dist/esm/index.js CHANGED
@@ -1,8 +1,6 @@
1
1
  import { Stream } from 'node:stream';
2
2
  import { stripVTControlCharacters } from 'node:util';
3
3
  import MuteStream from 'mute-stream';
4
- import ansiEscapes from 'ansi-escapes';
5
- const ignoredAnsi = new Set([ansiEscapes.cursorHide, ansiEscapes.cursorShow]);
6
4
  class BufferedStream extends Stream.Writable {
7
5
  #_fullOutput = '';
8
6
  #_chunks = [];
@@ -10,11 +8,8 @@ class BufferedStream extends Stream.Writable {
10
8
  _write(chunk, _encoding, callback) {
11
9
  const str = chunk.toString();
12
10
  this.#_fullOutput += str;
13
- // There's some ANSI Inquirer just send to keep state of the terminal clear; we'll ignore those since they're
14
- // unlikely to be used by end users or part of prompt code.
15
- if (!ignoredAnsi.has(str)) {
16
- this.#_rawChunks.push(str);
17
- }
11
+ // Keep track of every chunk send through.
12
+ this.#_rawChunks.push(str);
18
13
  // Stripping the ANSI codes here because Inquirer will push commands ANSI (like cursor move.)
19
14
  // This is probably fine since we don't care about those for testing; but this could become
20
15
  // an issue if we ever want to test for those.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/testing",
3
- "version": "2.1.48",
3
+ "version": "2.1.50",
4
4
  "description": "Inquirer testing utilities",
5
5
  "keywords": [
6
6
  "answer",
@@ -77,14 +77,13 @@
77
77
  "tsc": "tshy"
78
78
  },
79
79
  "dependencies": {
80
- "@inquirer/type": "^3.0.7",
81
- "ansi-escapes": "^4.3.2",
80
+ "@inquirer/type": "^3.0.8",
82
81
  "mute-stream": "^2.0.0"
83
82
  },
84
83
  "devDependencies": {
85
- "@arethetypeswrong/cli": "^0.18.1",
84
+ "@arethetypeswrong/cli": "^0.18.2",
86
85
  "@types/mute-stream": "^0.0.4",
87
- "@types/node": "^24.0.1",
86
+ "@types/node": "^24.0.15",
88
87
  "tshy": "^3.0.2"
89
88
  },
90
89
  "engines": {
@@ -107,5 +106,5 @@
107
106
  "optional": true
108
107
  }
109
108
  },
110
- "gitHead": "43b7bb94390c1e2b6473af1b790ff2fd1c8007c8"
109
+ "gitHead": "8300fe3acb1a7ded247d3ec3aac9b0c96dcdd57c"
111
110
  }