File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
packages/amazonq/test/e2e/amazonq/framework Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change 33 * SPDX-License-Identifier: Apache-2.0
44 */
55
6- import { JSDOM } from 'jsdom'
6+ import { JSDOM , VirtualConsole } from 'jsdom'
77
8+ /**
9+ * JSDOM is used to help hoist MynahUI to running in a node environment vs in the browser (which is what it's made for)
10+ */
811export function injectJSDOM ( ) {
9- /**
10- * JSDOM is used to help hoist MynahUI to running in a node environment vs in the browser (which is what it's made for)
11- */
12+ const virtualConsole = new VirtualConsole ( )
13+ virtualConsole . on ( 'error' , ( error ) => {
14+ // JSDOM can't load scss from mynah UI, just skip it
15+ if ( ! error . includes ( 'Could not parse CSS stylesheet' ) ) {
16+ console . error ( error )
17+ }
18+ } )
19+
1220 const dom = new JSDOM ( undefined , {
1321 pretendToBeVisual : true ,
1422 includeNodeLocations : true ,
23+ virtualConsole,
1524 } )
1625 global . window = dom . window as unknown as Window & typeof globalThis
1726 global . document = dom . window . document
You can’t perform that action at this time.
0 commit comments