@stencil/vitest 1.1.14 → 1.1.16

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":"html-serializer.d.ts","sourceRoot":"","sources":["../../src/testing/html-serializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,qCAAqC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,gBAAgB,GAAG,MAAM,EAC3D,OAAO,GAAE,gBAAqB,GAC7B,MAAM,CAWR;AAoGD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkDjD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
1
+ {"version":3,"file":"html-serializer.d.ts","sourceRoot":"","sources":["../../src/testing/html-serializer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,qCAAqC;IACrC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,WAAW,GAAG,UAAU,GAAG,gBAAgB,GAAG,MAAM,EAC3D,OAAO,GAAE,gBAAqB,GAC7B,MAAM,CAWR;AAkHD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAkDjD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD"}
@@ -37,6 +37,10 @@ function serializeElementWithShadow(element, excludeStyles, serializeShadowRoot
37
37
  if (text)
38
38
  html += text;
39
39
  }
40
+ else if (child.nodeType === 8 && !!child.textContent) {
41
+ // Comment node
42
+ html += `<!--${child.textContent}-->`;
43
+ }
40
44
  }
41
45
  return html;
42
46
  }
@@ -48,7 +52,13 @@ function serializeElementWithShadow(element, excludeStyles, serializeShadowRoot
48
52
  if (elem.attributes) {
49
53
  for (let i = 0; i < elem.attributes.length; i++) {
50
54
  const attr = elem.attributes[i];
51
- html += ` ${attr.name}="${attr.value}"`;
55
+ // Boolean attributes (empty string value) should not have ="value"
56
+ if (attr.value === '') {
57
+ html += ` ${attr.name}`;
58
+ }
59
+ else {
60
+ html += ` ${attr.name}="${attr.value}"`;
61
+ }
52
62
  }
53
63
  }
54
64
  html += '>';
@@ -77,6 +87,10 @@ function serializeElementWithShadow(element, excludeStyles, serializeShadowRoot
77
87
  if (text)
78
88
  html += text;
79
89
  }
90
+ else if (child.nodeType === 8 && !!child.textContent) {
91
+ // Comment node
92
+ html += `<!--${child.textContent}-->`;
93
+ }
80
94
  }
81
95
  html += '</mock:shadow-root>';
82
96
  }
@@ -101,6 +115,10 @@ function serializeElementWithShadow(element, excludeStyles, serializeShadowRoot
101
115
  if (text)
102
116
  html += text;
103
117
  }
118
+ else if (child.nodeType === 8 && !!child.textContent) {
119
+ // Comment node
120
+ html += `<!--${child.textContent}-->`;
121
+ }
104
122
  }
105
123
  html += `</${tagName}>`;
106
124
  return html;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/stenciljs/vitest"
6
6
  },
7
- "version": "1.1.14",
7
+ "version": "1.1.16",
8
8
  "description": "First-class testing utilities for Stencil design systems with Vitest",
9
9
  "license": "MIT",
10
10
  "type": "module",
@@ -97,7 +97,7 @@
97
97
  "dependencies": {
98
98
  "jiti": "^2.6.1",
99
99
  "local-pkg": "^1.1.2",
100
- "vitest-environment-stencil": "1.1.14"
100
+ "vitest-environment-stencil": "1.1.16"
101
101
  },
102
102
  "devDependencies": {
103
103
  "@eslint/js": "^9.39.2",