Martin
Martin•12mo ago

deno tap metadata

Hello. I am running deno tests with deno test --reporter=tap. I would like to add additional fields (medatata) to test output as YAML Diagnostic document. This would require some Deno test API for adding metadata: Deno.test({ name: "some test", metadata: { foo: "bar" }, fn: () => {}); or Deno.test({ name: "some test", fn: (t) => { t.set("foo", "bar"); }); this would produce TAP version 14 # ./foo.test.ts ok 1 - some test --- foo: bar ... Is something like this planned? And can I now work it around somehow?
2 Replies
Deno AI Helper
Deno AI Helper•12mo ago
Based on the documentation, there is currently no explicit mention of a feature that allows adding metadata to test output in the TAP reporter format. The Deno.test() function does not seem to support a metadata field in its options, and there is no set method available in the test context. However, you can always propose this feature to the Deno community on the official Deno GitHub repository. The Deno project is open-source and contributions are always welcome. As for a workaround, you might consider including any necessary metadata in the test name or in console log statements within the test, although this would not have the same structured format as the YAML Diagnostic document you're aiming for. Please note that this workaround is not explicitly mentioned in the documentation and might not be ideal for your use case. 🦕
Martin
Martin•12mo ago
Console.log makes no output if reporter is tap.