Given this test:
import test from "node:test";
test("root", t => {
t.diagnostic("one");
t.test("child", t => {
t.diagnostic("two");
});
t.diagnostic("three");
});
I expect to get this result:
{
"tests": [
{
"name": "root",
"file": "dm.test.js",
"tests": [
{
"name": "child",
"file": "dm.test.js",
"tests": [],
"duration": 0.315334,
"skip": false,
"todo": false,
"diagnostic": "two"
}
],
"duration": 0.731083,
"skip": false,
"todo": false,
"diagnostic": "one\nthree\n"
}
],
"duration": 50.446458
}
But instead I get this:
{
"tests": [
{
"name": "root",
"file": "dm.test.js",
"tests": [
{
"name": "child",
"file": "dm.test.js",
"tests": [],
"duration": 0.315334,
"skip": false,
"todo": false
}
],
"duration": 0.731083,
"skip": false,
"todo": false,
"diagnostic": "two\n"
}
],
"duration": 50.446458
}
Note that the diagnostic "two" is reported on the root test, the child test has no diagnostic, and the diagnostics "one" and "three" are lost.
Given this test:
I expect to get this result:
{ "tests": [ { "name": "root", "file": "dm.test.js", "tests": [ { "name": "child", "file": "dm.test.js", "tests": [], "duration": 0.315334, "skip": false, "todo": false, "diagnostic": "two" } ], "duration": 0.731083, "skip": false, "todo": false, "diagnostic": "one\nthree\n" } ], "duration": 50.446458 }But instead I get this:
{ "tests": [ { "name": "root", "file": "dm.test.js", "tests": [ { "name": "child", "file": "dm.test.js", "tests": [], "duration": 0.315334, "skip": false, "todo": false } ], "duration": 0.731083, "skip": false, "todo": false, "diagnostic": "two\n" } ], "duration": 50.446458 }Note that the diagnostic "two" is reported on the root test, the child test has no diagnostic, and the diagnostics "one" and "three" are lost.