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

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

diff --git a/test/javascripts/helpers/widget-test.js b/test/javascripts/helpers/widget-test.js
index 2289e73..6cd3fbd 100644
--- a/test/javascripts/helpers/widget-test.js
+++ b/test/javascripts/helpers/widget-test.js
@@ -1,7 +1,14 @@
 import componentTest from "helpers/component-test";
 
-export function moduleForWidget(name) {
-  moduleForComponent(name, `widget:${name}`, { integration: true });
+export function moduleForWidget(name, options = {}) {
+  moduleForComponent(
+    name,
+    `widget:${name}`,
+    Object.assign(
+      { integration: true },
+      { beforeEach: options.beforeEach, afterEach: options.afterEach }
+    )
+  );
 }
 
 export function widgetTest(name, opts) {

GitHub sha: acdbcabd

This commit appears in #9296 which was approved by eviltrout. It was merged by jjaffeux.