Skip to content

Commit 8a12fac

Browse files
committed
test(cli): judge undefined on the publish command's output, not on oclif's plugin warning
Run without a config root, oclif roots its config at @oclif/core and warns that the dev plugins its manifest names are missing. From @oclif/core 5.1.12 that warning inspects plugin options that carry `ignoreManifest: undefined`, so the whole-console `not.toContain('undefined')` read the warning instead of the command's failure line. Claude-Session: https://claude.ai/code/session_01L9qibzpqH1nQTsbGckLspg Co-authored-by: Claude <noreply@anthropic.com>
1 parent 93f7abb commit 8a12fac

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

‎packages/cli/test/package-publish-error-envelope.test.ts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ describe('os package publish — a failed publish shows the server’s reason',
213213
const printed = output.join('\n');
214214
expect(printed).toContain('HTTP 500');
215215
expect(printed).not.toContain('[object');
216-
expect(printed).not.toContain('undefined');
216+
// `undefined` is judged on what the command printed, not on a Node process
217+
// warning (`(node:PID) …`) that lands on the same console. Run without a
218+
// config root, oclif roots the config at `@oclif/core` itself and warns that
219+
// its dev plugins are missing; from 5.1.12 that warning inspects its plugin
220+
// options, `ignoreManifest: undefined` among them.
221+
const commandOutput = output.filter((line) => !line.startsWith('(node:')).join('\n');
222+
expect(commandOutput).not.toContain('undefined');
217223
});
218224
});

0 commit comments

Comments
 (0)