Skip to content

Commit f49d841

Browse files
committed
fix: add lifecycle call for onEnd for rules
1 parent c16275d commit f49d841

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/coverage.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ export default async (options: IOptions) => {
5858
reporter.onBegin(options, exampleCalls);
5959
}
6060

61-
if (options.rules && options.rules.length > 0) {
62-
for (const rule of options.rules) {
63-
await Promise.resolve(rule.onBegin?.(options));
64-
}
61+
for (const rule of rules) {
62+
await Promise.resolve(rule.onBegin?.(options));
6563
}
6664

6765
// getExampleCalls could be async or sync
@@ -112,6 +110,10 @@ export default async (options: IOptions) => {
112110
}
113111
}
114112

113+
for (const rule of rules) {
114+
await Promise.resolve(rule.onEnd?.(options, exampleCalls));
115+
}
116+
115117
for (const reporter of options.reporters) {
116118
reporter.onEnd(options, exampleCalls);
117119
}

0 commit comments

Comments
 (0)