Skip to content

Commit

Permalink
refactor: reorder group benchmark hooks call
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
  • Loading branch information
jerome-benoit committed May 18, 2024
1 parent 7096d00 commit 8f86ac8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,14 @@ export async function run(opts = {}) {
log(clr.gray(opts.colors, table.br(opts)));
}

const groupBenchmarks = benchmarks.filter(
benchmark => benchmark.group === group,
);

AsyncFunction === groupOpts.before.constructor
? await groupOpts.before()
: groupOpts.before();

const groupBenchmarks = benchmarks.filter(
benchmark => benchmark.group === group,
);
once = await executeBenchmarks(groupBenchmarks, log, opts);

AsyncFunction === groupOpts.after.constructor
Expand Down

0 comments on commit 8f86ac8

Please sign in to comment.