Skip to content

Commit 84a3607

Browse files
fix(mock-doc): don't show error message for SSR workflows (#6075)
* fix(mock-doc): don't show error message for SSR workflows * prettier
1 parent ec243c2 commit 84a3607

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/mock-doc/node.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,15 @@ export class MockElement extends MockNode {
234234
attachInternals(): MockElementInternals {
235235
return new Proxy({} as unknown as MockElementInternals, {
236236
get: function (_target, prop, _receiver) {
237-
console.error(
238-
`NOTE: Property ${String(prop)} was accessed on ElementInternals, but this property is not implemented.
239-
Testing components with ElementInternals is fully supported in e2e tests.`,
240-
);
237+
/**
238+
* only print warning when running in a test environment
239+
*/
240+
if ('process' in globalThis && globalThis.process.env.__STENCIL_SPEC_TESTS__) {
241+
console.error(
242+
`NOTE: Property ${String(prop)} was accessed on ElementInternals, but this property is not implemented.
243+
Testing components with ElementInternals is fully supported in e2e tests.`,
244+
);
245+
}
241246
},
242247
});
243248
}

0 commit comments

Comments
 (0)