James
James•4d ago

Test Case Names Disappearing?

Has anyone else run into this? Some of my test case names disappear:
running 15 tests from ./tests/config_test.js
Configuration can be loaded from options only ... ok (19ms)
ok (8ms)
Configuration options take precedence over data object ... ok (4ms)
ok (6ms)
Configuration has data object data ... ok (2ms)
running 15 tests from ./tests/config_test.js
Configuration can be loaded from options only ... ok (19ms)
ok (8ms)
Configuration options take precedence over data object ... ok (4ms)
ok (6ms)
Configuration has data object data ... ok (2ms)
The lines starting with "ok" are individual test cases with names. But the names don't show up... It is always the same test cases too, regardless of where I place them. Here is an example of the first two test cases, the first appears, the second doesn't:
Deno.test({
name: "Configuration can be loaded from options only",
fn: async () => {
const config = await Config.load(defaultOptions, undefined);
assertEquals(config.src, "mySrc");
assertEquals(config.templates, "myTemplates");
assertEquals(config.out, "myOut");
assertFalse(config.isDev);
assertFalse(config.isDebug);
},
});

Deno.test({
name: "Configuration can be loaded from data object only",
fn: async () => {
const config = await Config.load({}, dataFilePath("defaultData.js"));
assertEquals(dataRelativePath(config.src), "myDataSrc");
assertEquals(dataRelativePath(config.templates), "myDataTemplates");
assertEquals(dataRelativePath(config.out), "myDataOut");
assertFalse(config.isDev);
assertFalse(config.isDebug);
},
});
Deno.test({
name: "Configuration can be loaded from options only",
fn: async () => {
const config = await Config.load(defaultOptions, undefined);
assertEquals(config.src, "mySrc");
assertEquals(config.templates, "myTemplates");
assertEquals(config.out, "myOut");
assertFalse(config.isDev);
assertFalse(config.isDebug);
},
});

Deno.test({
name: "Configuration can be loaded from data object only",
fn: async () => {
const config = await Config.load({}, dataFilePath("defaultData.js"));
assertEquals(dataRelativePath(config.src), "myDataSrc");
assertEquals(dataRelativePath(config.templates), "myDataTemplates");
assertEquals(dataRelativePath(config.out), "myDataOut");
assertFalse(config.isDev);
assertFalse(config.isDebug);
},
});
I can't see any obvious differences between them, but maybe I'm just missing something obvious.
4 Replies
ud2
ud2•4d ago
I've been seeing a similar issue. Bisected it to a17c53c. Reproduction:
Deno.test("repro", () => {
new Worker("data:text/javascript,close()", { type: "module" });
});
Deno.test("repro", () => {
new Worker("data:text/javascript,close()", { type: "module" });
});
James
JamesOP•4d ago
Hmm. Good to know it's not just me and some weird tests I'm writing. Setting -q seems to get around it for now. Have you created an issue for this?
ud2
ud2•4d ago
No, I haven't. Please go ahead.
James
JamesOP•4d ago
Even after you did all the work bisecting and creating minimum reproductions? 😔

Did you find this page helpful?