diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d03936b..c7bbc23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ concurrency: jobs: test: name: Run tests on Node.js ${{ matrix.node-version }} - runs-on: self-hosted-arc + runs-on: ubuntu-latest strategy: matrix: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 694f601..9539acd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ permissions: jobs: release-please: - runs-on: self-hosted-arc + runs-on: ubuntu-latest outputs: release_created: ${{ steps.release.outputs.release_created }} steps: @@ -29,7 +29,7 @@ jobs: publish: needs: release-please if: ${{ needs.release-please.outputs.release_created }} - runs-on: self-hosted-arc + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/src/index.ts b/src/index.ts index 4132b09..8c47001 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,7 +40,12 @@ const DOM_TESTING_LIBRARY_UMD_PATH = path.join( "dist/@testing-library/dom.umd.js", ); -const DOM_TESTING_LIBRARY_UMD = fs.readFileSync(DOM_TESTING_LIBRARY_UMD_PATH).toString().replace("define.amd", "false"); +const DOM_TESTING_LIBRARY_UMD = fs + .readFileSync(DOM_TESTING_LIBRARY_UMD_PATH) + .toString() + .replace("define.amd", "false") + // exports and module are defined in component tests. Without this patch, testing-library won't init + .replace("typeof exports === 'object' && typeof module !== 'undefined'", "false"); let _config: Partial; @@ -90,7 +95,7 @@ async function injectDOMTestingLibrary(container: WebdriverIO.Element) { ); } } else { - eval(library); + window.eval(library); } }, DOM_TESTING_LIBRARY_UMD); }