@principles/pd-cli 1.74.0 → 1.76.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.
Files changed (38) hide show
  1. package/dist/commands/config-doctor.d.ts +3 -6
  2. package/dist/commands/config-doctor.d.ts.map +1 -1
  3. package/dist/commands/config-doctor.js +30 -31
  4. package/dist/commands/config-doctor.js.map +1 -1
  5. package/dist/commands/console.d.ts +18 -0
  6. package/dist/commands/console.d.ts.map +1 -1
  7. package/dist/commands/console.js +439 -0
  8. package/dist/commands/console.js.map +1 -1
  9. package/dist/commands/runtime-features.d.ts +23 -8
  10. package/dist/commands/runtime-features.d.ts.map +1 -1
  11. package/dist/commands/runtime-features.js +72 -31
  12. package/dist/commands/runtime-features.js.map +1 -1
  13. package/dist/index.js +51 -15
  14. package/dist/index.js.map +1 -1
  15. package/dist/services/config-doctor.d.ts +26 -66
  16. package/dist/services/config-doctor.d.ts.map +1 -1
  17. package/dist/services/config-doctor.js +197 -374
  18. package/dist/services/config-doctor.js.map +1 -1
  19. package/dist/services/console-launcher.d.ts +110 -0
  20. package/dist/services/console-launcher.d.ts.map +1 -0
  21. package/dist/services/console-launcher.js +282 -0
  22. package/dist/services/console-launcher.js.map +1 -0
  23. package/dist/services/pd-config-loader.d.ts +64 -0
  24. package/dist/services/pd-config-loader.d.ts.map +1 -0
  25. package/dist/services/pd-config-loader.js +156 -0
  26. package/dist/services/pd-config-loader.js.map +1 -0
  27. package/package.json +1 -1
  28. package/src/commands/config-doctor.ts +30 -30
  29. package/src/commands/console.ts +445 -1
  30. package/src/commands/runtime-features.ts +98 -44
  31. package/src/index.ts +55 -16
  32. package/src/services/config-doctor.ts +236 -425
  33. package/src/services/console-launcher.ts +373 -0
  34. package/src/services/pd-config-loader.ts +213 -0
  35. package/tests/commands/config-doctor.test.ts +207 -506
  36. package/tests/commands/console-open.test.ts +773 -0
  37. package/tests/commands/runtime-features.test.ts +220 -85
  38. package/tests/services/pd-config-loader.test.ts +479 -0
@@ -0,0 +1,479 @@
1
+ /**
2
+ * pd-config-loader tests — PRI-305
3
+ *
4
+ * Covers:
5
+ * - Missing config → defaults with nextAction
6
+ * - Malformed config → fail loud with errors and nextAction
7
+ * - Valid config → effective config with source='user_config'
8
+ * - OpenClaw reference summary shows safe label/id only
9
+ * - PD-local profile summary shows apiKeyEnv, not secret value
10
+ * - Per-agent override summary
11
+ * - No secret output in any result
12
+ * - Legacy file detection
13
+ * - JSON purity of outputs
14
+ */
15
+
16
+ import { describe, it, expect } from 'vitest';
17
+ import * as fs from 'node:fs';
18
+ import * as path from 'node:path';
19
+ import * as os from 'node:os';
20
+ import * as yaml from 'js-yaml';
21
+ import {
22
+ loadPdConfig,
23
+ computeFlagsFromLoadResult,
24
+ redactLoadResult,
25
+ getPdConfigPath,
26
+ PD_CONFIG_DIR,
27
+ PD_CONFIG_FILENAME,
28
+ } from '../../src/services/pd-config-loader.js';
29
+
30
+ // ── Helpers ─────────────────────────────────────────────────────────────────
31
+
32
+ function mkTmpDir(): string {
33
+ return fs.mkdtempSync(path.join(os.tmpdir(), 'pd-config-loader-test-'));
34
+ }
35
+
36
+ function rmTmpDir(dir: string): void {
37
+ try { fs.rmSync(dir, { recursive: true, force: true }); } catch { /* ignore */ }
38
+ }
39
+
40
+ function writeConfig(workspaceDir: string, content: string): void {
41
+ const configDir = path.join(workspaceDir, PD_CONFIG_DIR);
42
+ fs.mkdirSync(configDir, { recursive: true });
43
+ fs.writeFileSync(path.join(configDir, PD_CONFIG_FILENAME), content, 'utf8');
44
+ }
45
+
46
+ function makeValidConfigYaml(): string {
47
+ return yaml.dump({
48
+ version: 1,
49
+ features: {
50
+ prompt: { category: 'core', enabled: true },
51
+ code_tool_hook: { category: 'core', enabled: true },
52
+ defer_archive: { category: 'core', enabled: true },
53
+ correction_observer: { category: 'quiet', enabled: false },
54
+ empathy_observer: { category: 'quiet', enabled: false },
55
+ },
56
+ runtimeProfiles: {
57
+ 'openclaw.default': { type: 'openclaw', source: 'default' },
58
+ 'openclaw.model.lmstudio.qwen3': { type: 'openclaw', provider: 'lmstudio', model: 'qwen3.6-27b-mtp' },
59
+ 'pd.anthropic-sonnet': { type: 'pi-ai', provider: 'anthropic', model: 'claude-3-5-sonnet', apiKeyEnv: 'ANTHROPIC_API_KEY', timeoutMs: 300000 },
60
+ },
61
+ internalAgents: {
62
+ defaultRuntime: 'openclaw.default',
63
+ agents: {
64
+ diagnostician: { enabled: true, runtimeProfile: 'openclaw.model.lmstudio.qwen3' },
65
+ dreamer: { enabled: true },
66
+ scribe: { enabled: true },
67
+ artificer: { enabled: true },
68
+ philosopher: { enabled: false },
69
+ evaluator: { enabled: false },
70
+ rolloutReviewer: { enabled: false },
71
+ trainer: { enabled: false },
72
+ correctionObserver: { enabled: false },
73
+ empathyObserver: { enabled: false },
74
+ },
75
+ },
76
+ ui: { diagnostics: { mode: 'simple' } },
77
+ });
78
+ }
79
+
80
+ // ── getPdConfigPath ──────────────────────────────────────────────────────────
81
+
82
+ describe('getPdConfigPath', () => {
83
+ it('returns path under .pd/config.yaml', () => {
84
+ expect(getPdConfigPath('/workspace/project')).toBe(
85
+ path.join('/workspace/project', '.pd', 'config.yaml'),
86
+ );
87
+ });
88
+ });
89
+
90
+ // ── Missing config → defaults ────────────────────────────────────────────────
91
+
92
+ describe('Missing config → defaults', () => {
93
+ it('returns ok=true with source=defaults when config file is absent', () => {
94
+ const tmp = mkTmpDir();
95
+ try {
96
+ const result = loadPdConfig(tmp);
97
+ expect(result.ok).toBe(true);
98
+ if (!result.ok) throw new Error('Expected ok');
99
+ expect(result.source).toBe('defaults');
100
+ expect(result.effective.config.version).toBe(1);
101
+ expect(result.effective.config.features.prompt.enabled).toBe(true);
102
+ expect(result.effective.config.features.code_tool_hook.enabled).toBe(true);
103
+ expect(result.effective.config.features.defer_archive.enabled).toBe(true);
104
+ } finally { rmTmpDir(tmp); }
105
+ });
106
+
107
+ it('defaults include all MVP core features enabled', () => {
108
+ const tmp = mkTmpDir();
109
+ try {
110
+ const result = loadPdConfig(tmp);
111
+ if (!result.ok) throw new Error('Expected ok');
112
+ const { features } = result.effective.config;
113
+ expect(features.prompt.enabled).toBe(true);
114
+ expect(features.prompt.category).toBe('core');
115
+ expect(features.code_tool_hook.enabled).toBe(true);
116
+ expect(features.defer_archive.enabled).toBe(true);
117
+ } finally { rmTmpDir(tmp); }
118
+ });
119
+
120
+ it('defaults include gone features disabled', () => {
121
+ const tmp = mkTmpDir();
122
+ try {
123
+ const result = loadPdConfig(tmp);
124
+ if (!result.ok) throw new Error('Expected ok');
125
+ expect(result.effective.config.features.nocturnal.enabled).toBe(false);
126
+ expect(result.effective.config.features.nocturnal.category).toBe('gone');
127
+ } finally { rmTmpDir(tmp); }
128
+ });
129
+
130
+ it('defaults include openclaw.default runtime profile', () => {
131
+ const tmp = mkTmpDir();
132
+ try {
133
+ const result = loadPdConfig(tmp);
134
+ if (!result.ok) throw new Error('Expected ok');
135
+ expect(Object.hasOwn(result.effective.config.runtimeProfiles, 'openclaw.default')).toBe(true);
136
+ } finally { rmTmpDir(tmp); }
137
+ });
138
+ });
139
+
140
+ // ── Malformed config → fail loud ────────────────────────────────────────────
141
+
142
+ describe('Malformed config → fail loud', () => {
143
+ it('returns ok=false with errors for YAML parse error', () => {
144
+ const tmp = mkTmpDir();
145
+ writeConfig(tmp, 'version: [unterminated');
146
+ try {
147
+ const result = loadPdConfig(tmp);
148
+ expect(result.ok).toBe(false);
149
+ if (result.ok) throw new Error('Expected error');
150
+ expect(result.source).toBe('malformed');
151
+ expect(result.errors.length).toBeGreaterThan(0);
152
+ expect(result.errors[0].reason).toMatch(/YAML parse error/i);
153
+ expect(result.errors[0].nextAction).toBeTruthy();
154
+ } finally { rmTmpDir(tmp); }
155
+ });
156
+
157
+ it('returns ok=false with errors for invalid version', () => {
158
+ const tmp = mkTmpDir();
159
+ writeConfig(tmp, yaml.dump({ version: 99, features: {}, runtimeProfiles: {}, internalAgents: { defaultRuntime: 'x', agents: {} } }));
160
+ try {
161
+ const result = loadPdConfig(tmp);
162
+ expect(result.ok).toBe(false);
163
+ if (result.ok) throw new Error('Expected error');
164
+ expect(result.errors.some(e => e.path === 'version')).toBe(true);
165
+ } finally { rmTmpDir(tmp); }
166
+ });
167
+
168
+ it('returns ok=false with errors for missing features', () => {
169
+ const tmp = mkTmpDir();
170
+ writeConfig(tmp, yaml.dump({ version: 1, runtimeProfiles: { 'openclaw.default': { type: 'openclaw', source: 'default' } }, internalAgents: { defaultRuntime: 'openclaw.default', agents: {} } }));
171
+ try {
172
+ const result = loadPdConfig(tmp);
173
+ expect(result.ok).toBe(false);
174
+ if (result.ok) throw new Error('Expected error');
175
+ expect(result.errors.some(e => e.path === 'features')).toBe(true);
176
+ } finally { rmTmpDir(tmp); }
177
+ });
178
+
179
+ it('returns ok=false with errors for non-boolean enabled', () => {
180
+ const tmp = mkTmpDir();
181
+ const config = yaml.dump({
182
+ version: 1,
183
+ features: { prompt: { category: 'core', enabled: 'yes' } },
184
+ runtimeProfiles: { 'openclaw.default': { type: 'openclaw', source: 'default' } },
185
+ internalAgents: { defaultRuntime: 'openclaw.default', agents: {} },
186
+ });
187
+ writeConfig(tmp, config);
188
+ try {
189
+ const result = loadPdConfig(tmp);
190
+ expect(result.ok).toBe(false);
191
+ if (result.ok) throw new Error('Expected error');
192
+ expect(result.errors.some(e => e.path.includes('enabled'))).toBe(true);
193
+ } finally { rmTmpDir(tmp); }
194
+ });
195
+
196
+ it('returns ok=false with errors for forbidden secret field', () => {
197
+ const tmp = mkTmpDir();
198
+ const config = yaml.dump({
199
+ version: 1,
200
+ features: { prompt: { category: 'core', enabled: true } },
201
+ runtimeProfiles: {
202
+ 'bad.profile': { type: 'openclaw', apiKey: 'sk-1234567890abcdef' },
203
+ 'openclaw.default': { type: 'openclaw', source: 'default' },
204
+ },
205
+ internalAgents: { defaultRuntime: 'openclaw.default', agents: {} },
206
+ });
207
+ writeConfig(tmp, config);
208
+ try {
209
+ const result = loadPdConfig(tmp);
210
+ expect(result.ok).toBe(false);
211
+ if (result.ok) throw new Error('Expected error');
212
+ expect(result.errors.some(e => e.reason.includes('forbidden secret field'))).toBe(true);
213
+ } finally { rmTmpDir(tmp); }
214
+ });
215
+
216
+ it('each error has reason and nextAction', () => {
217
+ const tmp = mkTmpDir();
218
+ writeConfig(tmp, 'version: [unterminated');
219
+ try {
220
+ const result = loadPdConfig(tmp);
221
+ if (result.ok) throw new Error('Expected error');
222
+ for (const error of result.errors) {
223
+ expect(error.reason.length).toBeGreaterThan(0);
224
+ expect(error.nextAction.length).toBeGreaterThan(0);
225
+ }
226
+ } finally { rmTmpDir(tmp); }
227
+ });
228
+
229
+ it('malformed result still provides usable defaults', () => {
230
+ const tmp = mkTmpDir();
231
+ writeConfig(tmp, 'version: [unterminated');
232
+ try {
233
+ const result = loadPdConfig(tmp);
234
+ if (result.ok) throw new Error('Expected error');
235
+ expect(result.defaults.config.version).toBe(1);
236
+ expect(result.defaults.config.features.prompt.enabled).toBe(true);
237
+ } finally { rmTmpDir(tmp); }
238
+ });
239
+ });
240
+
241
+ // ── Valid config → effective config ──────────────────────────────────────────
242
+
243
+ describe('Valid config → effective config', () => {
244
+ it('returns ok=true with source=user_config for valid config', () => {
245
+ const tmp = mkTmpDir();
246
+ writeConfig(tmp, makeValidConfigYaml());
247
+ try {
248
+ const result = loadPdConfig(tmp);
249
+ expect(result.ok).toBe(true);
250
+ if (!result.ok) throw new Error('Expected ok');
251
+ expect(result.source).toBe('user_config');
252
+ expect(result.effective.config.version).toBe(1);
253
+ } finally { rmTmpDir(tmp); }
254
+ });
255
+
256
+ it('preserves user feature overrides', () => {
257
+ const tmp = mkTmpDir();
258
+ writeConfig(tmp, makeValidConfigYaml());
259
+ try {
260
+ const result = loadPdConfig(tmp);
261
+ if (!result.ok) throw new Error('Expected ok');
262
+ expect(result.effective.config.features.correction_observer.enabled).toBe(false);
263
+ } finally { rmTmpDir(tmp); }
264
+ });
265
+
266
+ it('preserves runtime profiles', () => {
267
+ const tmp = mkTmpDir();
268
+ writeConfig(tmp, makeValidConfigYaml());
269
+ try {
270
+ const result = loadPdConfig(tmp);
271
+ if (!result.ok) throw new Error('Expected ok');
272
+ expect(Object.hasOwn(result.effective.config.runtimeProfiles, 'pd.anthropic-sonnet')).toBe(true);
273
+ } finally { rmTmpDir(tmp); }
274
+ });
275
+ });
276
+
277
+ // ── OpenClaw reference summary ───────────────────────────────────────────────
278
+
279
+ describe('OpenClaw reference summary', () => {
280
+ it('shows safe label without secrets', () => {
281
+ const tmp = mkTmpDir();
282
+ writeConfig(tmp, makeValidConfigYaml());
283
+ try {
284
+ const result = loadPdConfig(tmp);
285
+ const summary = redactLoadResult(result);
286
+ const ocProfile = summary.runtimeProfiles.find(p => p.id === 'openclaw.model.lmstudio.qwen3');
287
+ expect(ocProfile).toBeDefined();
288
+ expect(ocProfile!.type).toBe('openclaw');
289
+ expect(ocProfile!.label).toContain('openclaw');
290
+ expect(ocProfile!.label).toContain('lmstudio');
291
+ expect(ocProfile!.apiKeyEnv).toBeUndefined();
292
+ } finally { rmTmpDir(tmp); }
293
+ });
294
+
295
+ it('does not contain raw provider object', () => {
296
+ const tmp = mkTmpDir();
297
+ writeConfig(tmp, makeValidConfigYaml());
298
+ try {
299
+ const result = loadPdConfig(tmp);
300
+ const summary = redactLoadResult(result);
301
+ const json = JSON.stringify(summary);
302
+ expect(json).not.toContain('"apiKey"');
303
+ expect(json).not.toContain('"gatewayToken"');
304
+ } finally { rmTmpDir(tmp); }
305
+ });
306
+ });
307
+
308
+ // ── PD-local profile summary ────────────────────────────────────────────────
309
+
310
+ describe('PD-local profile summary', () => {
311
+ it('shows apiKeyEnv name, not value', () => {
312
+ const tmp = mkTmpDir();
313
+ writeConfig(tmp, makeValidConfigYaml());
314
+ try {
315
+ const result = loadPdConfig(tmp);
316
+ const summary = redactLoadResult(result);
317
+ const pdProfile = summary.runtimeProfiles.find(p => p.id === 'pd.anthropic-sonnet');
318
+ expect(pdProfile).toBeDefined();
319
+ expect(pdProfile!.apiKeyEnv).toBe('ANTHROPIC_API_KEY');
320
+ const json = JSON.stringify(summary);
321
+ expect(json).not.toContain('sk-ant-');
322
+ } finally { rmTmpDir(tmp); }
323
+ });
324
+ });
325
+
326
+ // ── Per-agent override summary ───────────────────────────────────────────────
327
+
328
+ describe('Per-agent override summary', () => {
329
+ it('diagnostician uses explicit override, not defaultRuntime', () => {
330
+ const tmp = mkTmpDir();
331
+ writeConfig(tmp, makeValidConfigYaml());
332
+ try {
333
+ const result = loadPdConfig(tmp);
334
+ const summary = redactLoadResult(result);
335
+ const diag = summary.agents.find(a => a.name === 'diagnostician');
336
+ expect(diag).toBeDefined();
337
+ expect(diag!.runtimeProfileId).toBe('openclaw.model.lmstudio.qwen3');
338
+ expect(diag!.runtimeProfileLabel).toContain('lmstudio');
339
+ } finally { rmTmpDir(tmp); }
340
+ });
341
+
342
+ it('agent without override uses defaultRuntime', () => {
343
+ const tmp = mkTmpDir();
344
+ writeConfig(tmp, makeValidConfigYaml());
345
+ try {
346
+ const result = loadPdConfig(tmp);
347
+ const summary = redactLoadResult(result);
348
+ const dreamer = summary.agents.find(a => a.name === 'dreamer');
349
+ expect(dreamer).toBeDefined();
350
+ expect(dreamer!.runtimeProfileId).toBe('openclaw.default');
351
+ } finally { rmTmpDir(tmp); }
352
+ });
353
+ });
354
+
355
+ // ── No secret output ─────────────────────────────────────────────────────────
356
+
357
+ describe('No secret output', () => {
358
+ it('redacted summary never contains raw API key values', () => {
359
+ const tmp = mkTmpDir();
360
+ writeConfig(tmp, makeValidConfigYaml());
361
+ try {
362
+ const result = loadPdConfig(tmp);
363
+ const summary = redactLoadResult(result);
364
+ const json = JSON.stringify(summary);
365
+ expect(json).not.toContain('sk-ant-');
366
+ expect(json).not.toContain('sk-');
367
+ expect(json).not.toContain('"apiKey"');
368
+ expect(json).not.toContain('"baseUrl"');
369
+ expect(json).not.toContain('"gatewayToken"');
370
+ } finally { rmTmpDir(tmp); }
371
+ });
372
+
373
+ it('load result itself never contains secret values', () => {
374
+ const tmp = mkTmpDir();
375
+ writeConfig(tmp, makeValidConfigYaml());
376
+ try {
377
+ const result = loadPdConfig(tmp);
378
+ const json = JSON.stringify(result);
379
+ // apiKeyEnv is a field name, not a value — the value would be like "sk-ant-..."
380
+ expect(json).not.toMatch(/sk-ant-[a-zA-Z0-9]{8,}/);
381
+ } finally { rmTmpDir(tmp); }
382
+ });
383
+ });
384
+
385
+ // ── Feature flags from config ────────────────────────────────────────────────
386
+
387
+ describe('Feature flags from config', () => {
388
+ it('computeFlagsFromLoadResult returns MVP core channels enabled', () => {
389
+ const tmp = mkTmpDir();
390
+ try {
391
+ const result = loadPdConfig(tmp);
392
+ const flags = computeFlagsFromLoadResult(result);
393
+ expect(flags.enabledChannels).toContain('prompt');
394
+ expect(flags.enabledChannels).toContain('code_tool_hook');
395
+ expect(flags.enabledChannels).toContain('defer_archive');
396
+ } finally { rmTmpDir(tmp); }
397
+ });
398
+
399
+ it('computeFlagsFromLoadResult works with malformed config (uses defaults)', () => {
400
+ const tmp = mkTmpDir();
401
+ writeConfig(tmp, 'version: [unterminated');
402
+ try {
403
+ const result = loadPdConfig(tmp);
404
+ const flags = computeFlagsFromLoadResult(result);
405
+ expect(flags.enabledChannels).toContain('prompt');
406
+ } finally { rmTmpDir(tmp); }
407
+ });
408
+ });
409
+
410
+ // ── Legacy file detection ────────────────────────────────────────────────────
411
+
412
+ describe('Legacy file detection', () => {
413
+ it('detects .pd/feature-flags.yaml', () => {
414
+ const tmp = mkTmpDir();
415
+ const pdDir = path.join(tmp, '.pd');
416
+ fs.mkdirSync(pdDir, { recursive: true });
417
+ fs.writeFileSync(path.join(pdDir, 'feature-flags.yaml'), 'prompt:\n enabled: true\n', 'utf8');
418
+ try {
419
+ const result = loadPdConfig(tmp);
420
+ expect(result.legacyFilesDetected.length).toBeGreaterThan(0);
421
+ expect(result.legacyFilesDetected[0]).toContain('feature-flags.yaml');
422
+ } finally { rmTmpDir(tmp); }
423
+ });
424
+
425
+ it('detects .state/workflows.yaml', () => {
426
+ const tmp = mkTmpDir();
427
+ const stateDir = path.join(tmp, '.state');
428
+ fs.mkdirSync(stateDir, { recursive: true });
429
+ fs.writeFileSync(path.join(stateDir, 'workflows.yaml'), 'version: 1\n', 'utf8');
430
+ try {
431
+ const result = loadPdConfig(tmp);
432
+ expect(result.legacyFilesDetected.length).toBeGreaterThan(0);
433
+ expect(result.legacyFilesDetected[0]).toContain('workflows.yaml');
434
+ } finally { rmTmpDir(tmp); }
435
+ });
436
+
437
+ it('includes legacy warning when legacy files detected', () => {
438
+ const tmp = mkTmpDir();
439
+ const pdDir = path.join(tmp, '.pd');
440
+ fs.mkdirSync(pdDir, { recursive: true });
441
+ fs.writeFileSync(path.join(pdDir, 'feature-flags.yaml'), 'prompt:\n enabled: true\n', 'utf8');
442
+ try {
443
+ const result = loadPdConfig(tmp);
444
+ if (!result.ok) throw new Error('Expected ok');
445
+ expect(result.warnings.some(w => w.includes('Legacy config files detected'))).toBe(true);
446
+ } finally { rmTmpDir(tmp); }
447
+ });
448
+ });
449
+
450
+ // ── JSON purity ──────────────────────────────────────────────────────────────
451
+
452
+ describe('JSON purity', () => {
453
+ it('redacted summary is a single parseable JSON object', () => {
454
+ const tmp = mkTmpDir();
455
+ writeConfig(tmp, makeValidConfigYaml());
456
+ try {
457
+ const result = loadPdConfig(tmp);
458
+ const summary = redactLoadResult(result);
459
+ const json = JSON.stringify(summary, null, 2);
460
+ const parsed = JSON.parse(json);
461
+ expect(typeof parsed).toBe('object');
462
+ expect(parsed).not.toBeNull();
463
+ expect(Array.isArray(parsed)).toBe(false);
464
+ } finally { rmTmpDir(tmp); }
465
+ });
466
+
467
+ it('feature flags result is a single parseable JSON object', () => {
468
+ const tmp = mkTmpDir();
469
+ try {
470
+ const result = loadPdConfig(tmp);
471
+ const flags = computeFlagsFromLoadResult(result);
472
+ const json = JSON.stringify(flags, null, 2);
473
+ const parsed = JSON.parse(json);
474
+ expect(typeof parsed).toBe('object');
475
+ expect(parsed).not.toBeNull();
476
+ expect(Array.isArray(parsed)).toBe(false);
477
+ } finally { rmTmpDir(tmp); }
478
+ });
479
+ });