DEV: Allows moduleForWidget to use before/afterEach options (PR #9296)

GitHub

{ beforeEach: options.beforeEach, afterEach: options.afterEach } is simpler and doesn’t require an import.

This isn’t a dealbreaker for me but I would prefer it. If you disagree feel free to merge.