@brightspace-ui/testing 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@brightspace-ui/testing",
3
3
  "description": "Utilities for testing front-end components and applications",
4
4
  "type": "module",
5
- "version": "1.2.0",
5
+ "version": "1.3.0",
6
6
  "repository": "https://github.com/BrightspaceUI/testing.git",
7
7
  "scripts": {
8
8
  "lint": "eslint . --ext .js",
@@ -14,6 +14,15 @@ const BROWSER_MAP = {
14
14
  safari: 'webkit',
15
15
  webkit: 'webkit'
16
16
  };
17
+ const SUPPRESS_RESIZE_OBSERVER_ERRORS = `
18
+ <script>
19
+ window.addEventListener('error', (err) => {
20
+ if (err.message.includes('ResizeObserver')) {
21
+ err.stopImmediatePropagation();
22
+ }
23
+ });
24
+ </script>
25
+ `;
17
26
  export const DEFAULT_VDIFF_SLOW = 500;
18
27
 
19
28
  export class WTRConfig {
@@ -36,13 +45,7 @@ export class WTRConfig {
36
45
  `<!DOCTYPE html>
37
46
  <html lang="en">
38
47
  <body>
39
- <script>
40
- window.addEventListener('error', (err) => {
41
- if (err.message.includes('ResizeObserver')) {
42
- err.stopImmediatePropagation();
43
- }
44
- });
45
- </script>
48
+ ${SUPPRESS_RESIZE_OBSERVER_ERRORS}
46
49
  <script type="module" src="${testFramework}"></script>
47
50
  </body>
48
51
  </html>`,
@@ -103,6 +106,7 @@ export class WTRConfig {
103
106
  </style>
104
107
  </head>
105
108
  <body>
109
+ ${SUPPRESS_RESIZE_OBSERVER_ERRORS}
106
110
  <script type="module" src="${testFramework}"></script>
107
111
  </body>
108
112
  </html>`