Skip to content

Commit

Permalink
fix(mock-doc): don't show error message for SSR workflows (#6075)
Browse files Browse the repository at this point in the history
* fix(mock-doc): don't show error message for SSR workflows

* prettier
  • Loading branch information
christian-bromann authored Dec 11, 2024
1 parent ec243c2 commit 84a3607
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/mock-doc/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,15 @@ export class MockElement extends MockNode {
attachInternals(): MockElementInternals {
return new Proxy({} as unknown as MockElementInternals, {
get: function (_target, prop, _receiver) {
console.error(
`NOTE: Property ${String(prop)} was accessed on ElementInternals, but this property is not implemented.
Testing components with ElementInternals is fully supported in e2e tests.`,
);
/**
* only print warning when running in a test environment
*/
if ('process' in globalThis && globalThis.process.env.__STENCIL_SPEC_TESTS__) {
console.error(
`NOTE: Property ${String(prop)} was accessed on ElementInternals, but this property is not implemented.
Testing components with ElementInternals is fully supported in e2e tests.`,
);
}
},
});
}
Expand Down

0 comments on commit 84a3607

Please sign in to comment.