]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/pybind/mgr/dashboard/frontend/src/setupJest.ts
update ceph source to reef 18.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / setupJest.ts
index 9ff62e112368fddb46266cfff44ad6620615e615..646213554841a016248bf073ce0f968c46049b4f 100644 (file)
@@ -1,3 +1,15 @@
-import 'jest-preset-angular';
+import '@angular/localize/init';
+
+import 'jest-preset-angular/setup-jest';
 
 import './jestGlobalMocks';
+
+import { TextEncoder, TextDecoder } from 'util';
+
+Object.assign(global, { TextDecoder, TextEncoder });
+
+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}`;
+});