diff --git a/src/index.js b/src/index.js index e9437b7..f384daf 100644 --- a/src/index.js +++ b/src/index.js @@ -15,9 +15,20 @@ const SIMMERJS = fs.readFileSync(require.resolve('simmerjs/dist/simmer.js')).toS let _config = null; function injectNWTL(browser) { - browser.execute(DOM_TESTING_LIBRARY_UMD); + const shouldInject = browser.execute(function () { + return { + domTestingLibrary: !window.TestingLibraryDom, + simmer: !window.Simmer, + } + }); + + if (shouldInject.domTestingLibrary) { + browser.execute(DOM_TESTING_LIBRARY_UMD); + } - browser.execute(SIMMERJS); + if (shouldInject.simmer) { + browser.execute(SIMMERJS); + } if (_config) { // eslint-disable-next-line no-shadow