summaryrefslogtreecommitdiffstats
path: root/src/pybind/mgr/dashboard/frontend/src/setupJest.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/pybind/mgr/dashboard/frontend/src/setupJest.ts')
-rw-r--r--src/pybind/mgr/dashboard/frontend/src/setupJest.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/setupJest.ts b/src/pybind/mgr/dashboard/frontend/src/setupJest.ts
new file mode 100644
index 000000000..3f7654357
--- /dev/null
+++ b/src/pybind/mgr/dashboard/frontend/src/setupJest.ts
@@ -0,0 +1,11 @@
+import '@angular/localize/init';
+
+import 'jest-preset-angular';
+
+import './jestGlobalMocks';
+
+process.on('unhandledRejection', (error) => {
+ const stack = error['stack'] || '';
+ // Avoid potential hang on test failure when running tests in parallel.
+ throw `WARNING: unhandled rejection: ${error} ${stack}`;
+});