@brightspace-ui/testing 1.2.0 → 1.4.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 +1 -1
- package/src/server/wtr-config.js +14 -9
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.
|
|
5
|
+
"version": "1.4.0",
|
|
6
6
|
"repository": "https://github.com/BrightspaceUI/testing.git",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"lint": "eslint . --ext .js",
|
package/src/server/wtr-config.js
CHANGED
|
@@ -14,6 +14,16 @@ const BROWSER_MAP = {
|
|
|
14
14
|
safari: 'webkit',
|
|
15
15
|
webkit: 'webkit'
|
|
16
16
|
};
|
|
17
|
+
const TIMEZONE = '{"name":"Canada - Toronto","identifier":"America/Toronto"}';
|
|
18
|
+
const SUPPRESS_RESIZE_OBSERVER_ERRORS = `
|
|
19
|
+
<script>
|
|
20
|
+
window.addEventListener('error', (err) => {
|
|
21
|
+
if (err.message.includes('ResizeObserver')) {
|
|
22
|
+
err.stopImmediatePropagation();
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
</script>
|
|
26
|
+
`;
|
|
17
27
|
export const DEFAULT_VDIFF_SLOW = 500;
|
|
18
28
|
|
|
19
29
|
export class WTRConfig {
|
|
@@ -34,15 +44,9 @@ export class WTRConfig {
|
|
|
34
44
|
nodeResolve: true,
|
|
35
45
|
testRunnerHtml: testFramework =>
|
|
36
46
|
`<!DOCTYPE html>
|
|
37
|
-
<html lang="en">
|
|
47
|
+
<html lang="en" data-timezone='${TIMEZONE}'>
|
|
38
48
|
<body>
|
|
39
|
-
|
|
40
|
-
window.addEventListener('error', (err) => {
|
|
41
|
-
if (err.message.includes('ResizeObserver')) {
|
|
42
|
-
err.stopImmediatePropagation();
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
</script>
|
|
49
|
+
${SUPPRESS_RESIZE_OBSERVER_ERRORS}
|
|
46
50
|
<script type="module" src="${testFramework}"></script>
|
|
47
51
|
</body>
|
|
48
52
|
</html>`,
|
|
@@ -66,7 +70,7 @@ export class WTRConfig {
|
|
|
66
70
|
browsers: ['chrome'],
|
|
67
71
|
testRunnerHtml: testFramework =>
|
|
68
72
|
`<!DOCTYPE html>
|
|
69
|
-
<html lang="en">
|
|
73
|
+
<html lang="en" data-timezone='${TIMEZONE}'>
|
|
70
74
|
<head>
|
|
71
75
|
<link rel="preload" href="https://s.brightspace.com/lib/fonts/0.5.0/assets/Lato-400.woff2" as="font" type="font/woff2" crossorigin>
|
|
72
76
|
<link rel="preload" href="https://s.brightspace.com/lib/fonts/0.5.0/assets/Lato-700.woff2" as="font" type="font/woff2" crossorigin>
|
|
@@ -103,6 +107,7 @@ export class WTRConfig {
|
|
|
103
107
|
</style>
|
|
104
108
|
</head>
|
|
105
109
|
<body>
|
|
110
|
+
${SUPPRESS_RESIZE_OBSERVER_ERRORS}
|
|
106
111
|
<script type="module" src="${testFramework}"></script>
|
|
107
112
|
</body>
|
|
108
113
|
</html>`
|