test: add host registry output golden#88
Conversation
| username: 'alice', | ||
| }) | ||
|
|
||
| expect(results.every((result) => result.success)).toBe(true) |
There was a problem hiding this comment.
1/5 (nit, non-blocking)
It's usually better to map + then assert the array than to loop in this way and abort the test on the first failure.
Failures tend to be easier to understand in the array comparison approach.
| type: 'http', | ||
| url: 'https://be.glean.com/mcp/default', | ||
| headers: { 'X-Glean-Metadata': 'mdm' }, | ||
| }) |
There was a problem hiding this comment.
It's interesting that there's no inline snapshots here. I guess the view is inline snapshots aren't as relevant now that "manually" maintained complicated assertion objects can just be handled by agents?
| expect(codex).toContain('[mcp_servers.glean_default]') | ||
| expect(codex).toContain('url = "https://be.glean.com/mcp/default"') | ||
| expect(codex).toContain('X-Glean-Metadata = "mdm"') |
There was a problem hiding this comment.
1/5 (nit, non-blocking)
It's almost always better to assert the whole object than this one at a time stuff. It makes failures much easier to understand. If the object requires pre-processing (stripping dynamic things like dates &c.) it's still worth it so you can detect things like unexpected extra properties.
Adds a focused Linux configureHosts characterization test that exercises the real registry builder and asserts representative JSON, TOML, and Goose YAML output, including Goose default fields.
Tested: npm test -- --run src/hosts/configure-hosts.spec.ts