diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/__dot__azure/azure-pipelines.yml b/packages/cli/templates/react/igr-ts/projects/_base/files/__dot__azure/azure-pipelines.yml index f54ce8ee5..673ba184f 100644 --- a/packages/cli/templates/react/igr-ts/projects/_base/files/__dot__azure/azure-pipelines.yml +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/__dot__azure/azure-pipelines.yml @@ -19,5 +19,9 @@ steps: continueOnError: true - script: npm run build displayName: 'Build the project' + - script: npx playwright install chromium-headless-shell + displayName: 'Install Playwright browsers' - script: npm run test displayName: 'Run tests' + env: + CI: 'true' diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/__dot__github/workflows/node.js.yml b/packages/cli/templates/react/igr-ts/projects/_base/files/__dot__github/workflows/node.js.yml index 161dbc00e..08c9b9fc4 100644 --- a/packages/cli/templates/react/igr-ts/projects/_base/files/__dot__github/workflows/node.js.yml +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/__dot__github/workflows/node.js.yml @@ -29,5 +29,8 @@ jobs: - run: npm i # replace with 'npm ci' after committing lock file from first install # - run: npm run lint - run: npm run build + - name: Install Playwright browsers + run: npx playwright install chromium-headless-shell - run: npm run test - + env: + CI: 'true' diff --git a/packages/cli/templates/react/igr-ts/projects/_base/files/src/setupTests.ts b/packages/cli/templates/react/igr-ts/projects/_base/files/src/setupTests.ts index 38ac68997..ff1551bad 100644 --- a/packages/cli/templates/react/igr-ts/projects/_base/files/src/setupTests.ts +++ b/packages/cli/templates/react/igr-ts/projects/_base/files/src/setupTests.ts @@ -1,11 +1,10 @@ -import '@testing-library/jest-dom' import 'vitest-canvas-mock' import ResizeObserver from 'resize-observer-polyfill' import {vi} from 'vitest' -global.ResizeObserver = ResizeObserver; +globalThis.ResizeObserver = ResizeObserver; HTMLElement.prototype.scrollIntoView = vi.fn(); HTMLElement.prototype.hidePopover = vi.fn(); HTMLElement.prototype.showPopover = vi.fn(); -HTMLElement.prototype.togglePopover = vi.fn(); \ No newline at end of file +HTMLElement.prototype.togglePopover = vi.fn();