Skip to content

Commit 241c9c9

Browse files
raju-opticlaude
andauthored
[FSSDK-13413] Remove the old browser/UMD test setup and Karma leftovers (#1187)
## Summary Follow-up to #1186. `tests/browser` now runs browser and UMD tests in CI, so this removes the setup it replaced, plus leftovers from the Karma era. - **Remove the old root browser/UMD setup.** - Deleted: `vitest.browser.config.mts`, `vitest.umd.config.mts`, `scripts/run-browser-tests.js`, `scripts/run-umd-tests.js`, `scripts/patch-vitest-viewport.js`, `vitest/umd-plugin.ts`. - Root `package.json`: removed the `test-browser*` / `test-umd*` scripts and the `@vitest/browser`, `browserstack-local` and `webdriverio` devDependencies. - Root lockfile: 220 entries removed, none added. `npm uninstall` alone would have kept `@vitest/browser`/`webdriverio` and their dependencies as optional peers of the root Vitest, so those were pruned too. Re-resolving moved `@babel/runtime` from 7.28.4 to 7.29.13 (in range). - **Make `tests/browser` self-contained.** It no longer imports from the root `vitest/` folder, which is gone. - The request logger and `public/console-capture.js` moved into it. - The console-capture plugin was merged into the local one: it keeps the `/__vitest_console__` endpoint and injects the script via `transformIndexHtml`. - The UMD bundle is copied to `tests/browser/public/dist`, which is gitignored via `dist/`. - **Remove Karma leftovers.** - Deleted `lib/index.browser.umdtests.js`. Nothing ran it, and two of its imports no longer exist. - Removed the `*.umdtests.js` patterns from `.eslintignore`, both tsconfigs, `.platform-isolation.config.js` and `scripts/platform-utils.js`. - Removed the `BROWSER_STACK_*` env var fallbacks and the commented-out `crossbrowser_and_umd_unit_tests` CI job. - **Update docs and comments.** - Comments and the `tests/browser` README describe the current setup instead of comparing it with the removed one. - `vitest3-compat.setup.ts` is renamed to `restore-all-mocks.setup.ts`. - The root README's testing section points to `tests/browser`. - `CHANGELOG.md` keeps its historical entries. No SDK source changes. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 525e71d commit 241c9c9

29 files changed

Lines changed: 216 additions & 4548 deletions

‎.eslintignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
*.tests.js
2-
*.umdtests.js
32
test_data.js

‎.github/workflows/javascript.yml‎

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ jobs:
107107
TEST_BROWSER: ${{ matrix.browser }}
108108
steps:
109109
- uses: actions/checkout@v3
110-
# Runs the browser tests with Vitest 5 from tests/browser (see its README).
111-
# Needs Node 22.23.4+ (Vitest 5 / webdriverio); the root project stays on Vitest 3 for Node 18.
110+
# Browser and UMD tests run from tests/browser (see its README), which needs Node 22.23.4+.
112111
- name: Set up Node
113112
uses: actions/setup-node@v3
114113
with:
@@ -135,25 +134,6 @@ jobs:
135134
working-directory: ./tests/browser
136135
run: npm run test-umd
137136

138-
# crossbrowser_and_umd_unit_tests:
139-
# runs-on: ubuntu-latest
140-
# env:
141-
# BROWSER_STACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
142-
# BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
143-
# steps:
144-
# - uses: actions/checkout@v3
145-
# - name: Set up Node
146-
# uses: actions/setup-node@v3
147-
# with:
148-
# node-version: 16
149-
# cache: 'npm'
150-
# cache-dependency-path: ./package-lock.json
151-
# - name: Cross-browser and umd unit tests
152-
# working-directory: .
153-
# run: |
154-
# npm install
155-
# npm run test-ci
156-
157137
generate_messages_test:
158138
runs-on: ubuntu-latest
159139
steps:

‎.platform-isolation.config.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ module.exports = {
2323
'**/*.test.js',
2424
'**/*.spec.js',
2525
'**/*.tests.js',
26-
'**/*.umdtests.js',
2726
'**/*.test-d.ts',
2827

2928
// Generated files

‎README.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ To run unit tests, you can take the following steps:
231231
2. Run `npm test` to run all test files.
232232
3. Run `npm run test-vitest` to run only tests written using Vitest.
233233
4. Run `npm run test-mocha` to run only tests written using Mocha.
234-
5. (For cross-browser testing) Run `npm run test-browser-browserstack` to run browser tests via BrowserStack, or `npm run test-browser-local` to run them locally.
234+
5. (For cross-browser testing) Browser and UMD tests live in a separate project, [tests/browser](tests/browser) (Node 22.23.4+). Run `npm install` there, then `npm run test-browser-browserstack` to run browser tests via BrowserStack, or `npm run test-browser-local` to run them locally. See [tests/browser/README.md](tests/browser/README.md).
235235
6. Resolve any tests that fail before continuing with your contribution.
236236

237237
This information is relevant only if you plan on contributing to the SDK itself.
@@ -243,6 +243,10 @@ npm install
243243
# Run unit tests.
244244
npm test
245245

246+
# Browser and UMD tests run from tests/browser (needs Node 22.23.4+).
247+
cd tests/browser
248+
npm install
249+
246250
# Run browser tests locally.
247251
npm run test-browser-local
248252

@@ -256,7 +260,7 @@ npm run test-browser-browserstack
256260
npm run test-umd-browserstack
257261
```
258262

259-
[/.github/workflows/javascript.yml](/.github/workflows/javascript.yml) contains the definitions for `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` used in the GitHub Actions CI pipeline. When developing locally, you must provide your own credentials in order to run `npm run test-browser-browserstack`. You can register for an account for free on [the BrowserStack official website here](https://www.browserstack.com/).
263+
[/.github/workflows/javascript.yml](/.github/workflows/javascript.yml) contains the definitions for `BROWSERSTACK_USERNAME` and `BROWSERSTACK_ACCESS_KEY` used in the GitHub Actions CI pipeline. When developing locally, you must provide your own credentials in order to run `npm run test-browser-browserstack` in `tests/browser`. You can register for an account for free on [the BrowserStack official website here](https://www.browserstack.com/).
260264

261265
### Contributing
262266

‎lib/index.browser.umdtests.js‎

Lines changed: 0 additions & 300 deletions
This file was deleted.

0 commit comments

Comments
 (0)