@genesislcap/foundation-testing 13.8.0 → 14.0.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/jsdom/setup.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,KAAK,qBA4CjB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,qBAsCpB,CAAC"}
1
+ {"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/jsdom/setup.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,KAAK,qBAuEjB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,qBAsCpB,CAAC"}
@@ -14,6 +14,34 @@ export const setup = () => __awaiter(void 0, void 0, void 0, function* () {
14
14
  addListener: () => { },
15
15
  removeListener: () => { },
16
16
  });
17
+ /**
18
+ * There may have been a change to how the `CSSOM.parse(rule)` works, and how invalid rules are treated. Here we'll be
19
+ * more torrential of such issues given the limitations of JSDOM.
20
+ */
21
+ const cssInsertRule = window.CSSStyleSheet.prototype.insertRule;
22
+ window.CSSStyleSheet.prototype.insertRule = function (rule, index) {
23
+ try {
24
+ return cssInsertRule.call(this, rule, index);
25
+ }
26
+ catch (e) {
27
+ if (rule.includes('@import')) {
28
+ /**
29
+ * Longstanding issue it seems, https://github.com/jsdom/jsdom/issues/2124
30
+ */
31
+ console.log('Please note JSDOM does not support @import, skipping insertion.');
32
+ }
33
+ else {
34
+ /**
35
+ * Unknown malformation.
36
+ */
37
+ console.log('The CSS rule you are inserting is likely malformed', rule);
38
+ }
39
+ /**
40
+ * Return index as if were successful.
41
+ */
42
+ return index;
43
+ }
44
+ };
17
45
  globalThis.window = window;
18
46
  globalThis.customElements = window.customElements;
19
47
  globalThis.CSSImportRule = window.CSSImportRule;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-testing",
3
3
  "description": "Genesis Foundation Testing",
4
- "version": "13.8.0",
4
+ "version": "14.0.1",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -104,7 +104,7 @@
104
104
  "webpack-merge": "^5.7.3"
105
105
  },
106
106
  "dependencies": {
107
- "@genesislcap/foundation-utils": "^13.8.0",
107
+ "@genesislcap/foundation-utils": "^14.0.1",
108
108
  "@microsoft/fast-element": "^1.7.0",
109
109
  "@microsoft/fast-foundation": "^2.33.2",
110
110
  "sinon": "15.0.1",
@@ -114,5 +114,5 @@
114
114
  "publishConfig": {
115
115
  "access": "public"
116
116
  },
117
- "gitHead": "f4a6a702c9b7f181eb9eaecc9a928026cfaa573d"
117
+ "gitHead": "3a2d77277662d5b76fdfa282a3b0563aa23cb5f1"
118
118
  }