@inquirer/testing 3.3.15 → 3.4.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
@@ -131,7 +131,7 @@ it('shows a validation error', async () => {
131
131
 
132
132
  ### Unit Testing Example
133
133
 
134
- You can refer to the [`@inquirer/input` test suite](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/input.test.ts) for a comprehensive unit testing example using `render()`.
134
+ You can refer to the [`@inquirer/input` test suite](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/input/input.vitest.ts) for a comprehensive unit testing example using `render()`.
135
135
 
136
136
  ## E2E Testing with `screen`
137
137
 
@@ -238,7 +238,7 @@ jest.mock('@my-company/custom-prompt', () => {
238
238
 
239
239
  ### E2E Testing Example
240
240
 
241
- You can refer to the [`@inquirer/demo` test suite](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/demo/demo.test.ts) for a comprehensive E2E testing example using `screen`.
241
+ You can refer to the [`@inquirer/demo` test suite](https://github.com/SBoudrias/Inquirer.js/blob/main/packages/demo/demo.vitest.ts) for a comprehensive E2E testing example using `screen`.
242
242
 
243
243
  # License
244
244
 
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { stripVTControlCharacters } from 'node:util';
2
2
  import MuteStream from 'mute-stream';
3
- import { BufferedStream } from "./buffered-stream.js";
4
- import { interpretTerminalOutput } from "./terminal.js";
3
+ import { BufferedStream } from './buffered-stream.js';
4
+ import { interpretTerminalOutput } from './terminal.js';
5
5
  export async function render(prompt, config, options) {
6
6
  const input = new MuteStream();
7
7
  input.unmute();
package/dist/jest.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access */
2
2
  // Note: Jest's requireActual returns `any` by design, unlike Vitest's typed importOriginal
3
- import { Screen } from "./screen.js";
3
+ import { Screen } from './screen.js';
4
4
  // Global screen instance - exported for tests
5
5
  const screenInstance = new Screen();
6
6
  export { screenInstance as screen };
@@ -56,7 +56,7 @@ const promptNames = [
56
56
  jest.mock('@inquirer/input', () => {
57
57
  try {
58
58
  const actual = jest.requireActual('@inquirer/input');
59
- return { ...actual, default: wrapPrompt(actual.default) };
59
+ return { __esModule: true, ...actual, default: wrapPrompt(actual.default) };
60
60
  }
61
61
  catch {
62
62
  return {};
@@ -65,7 +65,7 @@ jest.mock('@inquirer/input', () => {
65
65
  jest.mock('@inquirer/select', () => {
66
66
  try {
67
67
  const actual = jest.requireActual('@inquirer/select');
68
- return { ...actual, default: wrapPrompt(actual.default) };
68
+ return { __esModule: true, ...actual, default: wrapPrompt(actual.default) };
69
69
  }
70
70
  catch {
71
71
  return {};
@@ -74,7 +74,7 @@ jest.mock('@inquirer/select', () => {
74
74
  jest.mock('@inquirer/confirm', () => {
75
75
  try {
76
76
  const actual = jest.requireActual('@inquirer/confirm');
77
- return { ...actual, default: wrapPrompt(actual.default) };
77
+ return { __esModule: true, ...actual, default: wrapPrompt(actual.default) };
78
78
  }
79
79
  catch {
80
80
  return {};
@@ -83,7 +83,7 @@ jest.mock('@inquirer/confirm', () => {
83
83
  jest.mock('@inquirer/checkbox', () => {
84
84
  try {
85
85
  const actual = jest.requireActual('@inquirer/checkbox');
86
- return { ...actual, default: wrapPrompt(actual.default) };
86
+ return { __esModule: true, ...actual, default: wrapPrompt(actual.default) };
87
87
  }
88
88
  catch {
89
89
  return {};
@@ -92,7 +92,7 @@ jest.mock('@inquirer/checkbox', () => {
92
92
  jest.mock('@inquirer/password', () => {
93
93
  try {
94
94
  const actual = jest.requireActual('@inquirer/password');
95
- return { ...actual, default: wrapPrompt(actual.default) };
95
+ return { __esModule: true, ...actual, default: wrapPrompt(actual.default) };
96
96
  }
97
97
  catch {
98
98
  return {};
@@ -101,7 +101,7 @@ jest.mock('@inquirer/password', () => {
101
101
  jest.mock('@inquirer/expand', () => {
102
102
  try {
103
103
  const actual = jest.requireActual('@inquirer/expand');
104
- return { ...actual, default: wrapPrompt(actual.default) };
104
+ return { __esModule: true, ...actual, default: wrapPrompt(actual.default) };
105
105
  }
106
106
  catch {
107
107
  return {};
@@ -110,7 +110,7 @@ jest.mock('@inquirer/expand', () => {
110
110
  jest.mock('@inquirer/rawlist', () => {
111
111
  try {
112
112
  const actual = jest.requireActual('@inquirer/rawlist');
113
- return { ...actual, default: wrapPrompt(actual.default) };
113
+ return { __esModule: true, ...actual, default: wrapPrompt(actual.default) };
114
114
  }
115
115
  catch {
116
116
  return {};
@@ -119,7 +119,7 @@ jest.mock('@inquirer/rawlist', () => {
119
119
  jest.mock('@inquirer/number', () => {
120
120
  try {
121
121
  const actual = jest.requireActual('@inquirer/number');
122
- return { ...actual, default: wrapPrompt(actual.default) };
122
+ return { __esModule: true, ...actual, default: wrapPrompt(actual.default) };
123
123
  }
124
124
  catch {
125
125
  return {};
@@ -128,7 +128,7 @@ jest.mock('@inquirer/number', () => {
128
128
  jest.mock('@inquirer/search', () => {
129
129
  try {
130
130
  const actual = jest.requireActual('@inquirer/search');
131
- return { ...actual, default: wrapPrompt(actual.default) };
131
+ return { __esModule: true, ...actual, default: wrapPrompt(actual.default) };
132
132
  }
133
133
  catch {
134
134
  return {};
@@ -137,7 +137,7 @@ jest.mock('@inquirer/search', () => {
137
137
  jest.mock('@inquirer/editor', () => {
138
138
  try {
139
139
  const actual = jest.requireActual('@inquirer/editor');
140
- return { ...actual, default: wrapPrompt(actual.default) };
140
+ return { __esModule: true, ...actual, default: wrapPrompt(actual.default) };
141
141
  }
142
142
  catch {
143
143
  return {};
@@ -195,4 +195,4 @@ jest.mock('@inquirer/external-editor', () => {
195
195
  };
196
196
  });
197
197
  // Re-export Screen class and KeypressEvent type for advanced use cases
198
- export { Screen } from "./screen.js";
198
+ export { Screen } from './screen.js';
package/dist/screen.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { stripVTControlCharacters } from 'node:util';
2
2
  import MuteStream from 'mute-stream';
3
- import { BufferedStream } from "./buffered-stream.js";
4
- import { interpretTerminalOutput } from "./terminal.js";
3
+ import { BufferedStream } from './buffered-stream.js';
4
+ import { interpretTerminalOutput } from './terminal.js';
5
5
  export class Screen {
6
6
  #input;
7
7
  #outputs = [];
package/dist/terminal.js CHANGED
@@ -1,4 +1,11 @@
1
- import xterm from '@xterm/headless';
1
+ import * as xtermModule from '@xterm/headless';
2
+ // @xterm/headless is a CommonJS bundle. Node's ESM loader only exposes it as
3
+ // `default` (its exports aren't statically detectable), while CommonJS
4
+ // transforms (e.g. Jest + SWC) expose `Terminal` on the namespace directly.
5
+ function resolveXterm(mod) {
6
+ return 'Terminal' in mod ? mod : mod.default;
7
+ }
8
+ const xterm = resolveXterm(xtermModule);
2
9
  export async function interpretTerminalOutput(rawOutput, cols = 10_000, rows = 4000) {
3
10
  const term = new xterm.Terminal({
4
11
  cols,
package/dist/vitest.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { vi, beforeEach } from 'vitest';
2
- import { Screen } from "./screen.js";
2
+ import { Screen } from './screen.js';
3
3
  // Global screen instance - exported for tests
4
4
  const screenInstance = new Screen();
5
5
  export { screenInstance as screen };
@@ -189,4 +189,4 @@ vi.mock('@inquirer/external-editor', async (importOriginal) => {
189
189
  };
190
190
  });
191
191
  // Re-export Screen class and KeypressEvent type for advanced use cases
192
- export { Screen } from "./screen.js";
192
+ export { Screen } from './screen.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inquirer/testing",
3
- "version": "3.3.15",
3
+ "version": "3.4.0",
4
4
  "description": "Inquirer testing utilities",
5
5
  "keywords": [
6
6
  "answer",
@@ -44,7 +44,7 @@
44
44
  "yo",
45
45
  "zsh"
46
46
  ],
47
- "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/main/packages/testing/README.md",
47
+ "homepage": "https://github.com/SBoudrias/Inquirer.js/blob/HEAD/packages/testing/README.md",
48
48
  "license": "MIT",
49
49
  "author": "Simon Boudrias <admin@simonboudrias.com>",
50
50
  "repository": {
@@ -83,16 +83,17 @@
83
83
  "tsc": "tsc"
84
84
  },
85
85
  "dependencies": {
86
- "@inquirer/type": "4.2.0",
86
+ "@inquirer/type": "4.3.0",
87
87
  "@xterm/headless": "^6.0.0",
88
- "mute-stream": "^3.0.0"
88
+ "mute-stream": "^4.0.0"
89
89
  },
90
90
  "devDependencies": {
91
- "@repo/tsconfig": "0.0.0",
91
+ "@inquirer/core": "^12.1.0",
92
+ "@repo/tsconfig": "0.1.0",
92
93
  "@types/jest": "^30.0.0",
93
94
  "@types/mute-stream": "^0.0.4",
94
95
  "@types/node": "^26.1.1",
95
- "typescript": "^6.0.2",
96
+ "typescript": "^7.0.2",
96
97
  "vite": "^8.3.0",
97
98
  "vitest": "^5.0.0"
98
99
  },
@@ -165,9 +166,9 @@
165
166
  }
166
167
  },
167
168
  "engines": {
168
- "node": ">=23.5.0 || ^22.13.0 || ^20.17.0"
169
+ "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
169
170
  },
170
171
  "main": "./dist/index.js",
171
172
  "types": "./dist/index.d.ts",
172
- "gitHead": "ea3130ebc609a6a3910b5397244044de7eda3d05"
173
+ "gitHead": "00ded073f80523aaeaf8a903bbfb535994990475"
173
174
  }