File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,12 @@ const DOM_TESTING_LIBRARY_UMD_PATH = path.join(
4040 "dist/@testing-library/dom.umd.js" ,
4141) ;
4242
43- const DOM_TESTING_LIBRARY_UMD = fs . readFileSync ( DOM_TESTING_LIBRARY_UMD_PATH ) . toString ( ) . replace ( "define.amd" , "false" ) ;
43+ const DOM_TESTING_LIBRARY_UMD = fs
44+ . readFileSync ( DOM_TESTING_LIBRARY_UMD_PATH )
45+ . toString ( )
46+ . replace ( "define.amd" , "false" )
47+ // exports and module are defined in component tests. Without this patch, testing-library won't init
48+ . replace ( "typeof exports === 'object' && typeof module !== 'undefined'" , "false" ) ;
4449
4550let _config : Partial < Config > ;
4651
@@ -90,7 +95,7 @@ async function injectDOMTestingLibrary(container: WebdriverIO.Element) {
9095 ) ;
9196 }
9297 } else {
93- eval ( library ) ;
98+ window . eval ( library ) ;
9499 }
95100 } , DOM_TESTING_LIBRARY_UMD ) ;
96101 }
You can’t perform that action at this time.
0 commit comments