-1

I have the following test.js file:

const test = require("ava");
test.before("foo", t => {
    someSetupThatMightThrow();
});
test("bar", t => {
    t.pass();
});
test.after("baz", t => {
    someTeardownThatMightThrow();
});

After running ava --verbose, if any of the hooks throw, I get a red X in the test report, which is great. But if nothing throws, I get only one green checkmark for the bar test:

green-checkmark bar 1 test passed

I would like to see green checkmarks relative to the before/after hooks as well, instead of them simply being omitted. How can I do this?

Pedro A
  • 3,989
  • 3
  • 32
  • 56
  • You shouldn't be running tests in before and after hooks at all; they're for setup and teardown of dependencies – Hamms Aug 05 '18 at 02:11
  • @Hamms I know... In my attempt to create a minimal example, I ended up giving the wrong idea. I've edited my question, please take a look again :) – Pedro A Aug 05 '18 at 02:18

1 Answers1

1

We won't output those in our regular reporters, sorry. I'd say don't worry: the hooks will run.

(Eventually down the line maybe we'd have a much more low-level reporter which would include this information, that you could build your own reporter on, but that's a ways away.)

Mark Wubben
  • 3,329
  • 1
  • 19
  • 16