• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

optimizely / javascript-sdk / 42257282852
78%

Build:
DEFAULT BRANCH: master
Ran 06 Nov 2026 04:59PM UTC
Jobs 4
Files 126
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Nov 2026 04:58PM UTC coverage: 77.513%. Remained the same
42257282852

push

github

web-flow
[FSSDK-13413] Run browser tests with Vitest 5 (#1186)

## Summary
Vitest browser mode is not stable in version 3. It fails frequently in CI, is very slow and also requires hacky modification to files in node_modules. This PR runs the tests using vitest@5 in a separate subproject. The root project stays on Vitest 3 so the Node tests keep running on Node 18.

- Add `tests/browser`, a standalone Vitest 5 project that runs the same browser and UMD spec files from `lib/` in real browsers, locally or on BrowserStack. It has its own `package.json`/lockfile, configs and runner (`run.js`).
- Point CI's `browser_tests` job at it. The job now uses Node 22 (Vitest 5 needs 22.12+), installs root deps, runs `npm ci` in `tests/browser`, then `npm run test-browser`. Matrix and secrets are unchanged.
- Run the UMD tests in CI again (`npm run test-umd` in `tests/browser`, as a step in the same job). It builds the UMD bundle and tests it in the same browsers, and runs even if the browser tests fail. The old UMD job was commented out.
- Make the `backoff_retry_runner` cancel test deterministic. It depended on how many microtask ticks an `await` takes, which differs on Safari 15. It now uses `ConstantBackoff(100)` and stops the last iteration 10ms short of the retry, so the cancel lands while the retry is waiting on a fake timer. The expected count is still 6.


Changes needed for the same specs to pass on Vitest 5 (details in `tests/browser/README.md` and comments in `vitest.shared.mts`):
- **`isolate: true`.** With shared iframes, a module loaded unmocked by one file stays unmocked for later files under Vitest 5.
- **`browser.importMapMocks: false`.** Always mock by request interception, as Vitest 3 does and as old browsers require.
- **`clearMocks: false` + `vitest3-compat.setup.ts`.** Vitest 5 defaults `clearMocks` to true, and `vi.restoreAllMocks()` no longer resets `vi.fn()` mocks. The specs rely on the Vitest 3 behavior of both.
- **Polyfills for `Array.prototype.a... (continued)

1564 of 3059 branches covered (51.13%)

Branch coverage included in aggregate %.

9001 of 10571 relevant lines covered (85.15%)

261.14 hits per line

Jobs
ID Job ID Ran Files Coverage
1 run-18 - 42257282852.1 06 Nov 2026 04:59PM UTC 126
77.51
GitHub Action Run
2 run-20 - 42257282852.2 06 Nov 2026 04:59PM UTC 126
77.51
GitHub Action Run
3 run-24 - 42257282852.3 06 Nov 2026 04:59PM UTC 126
77.51
GitHub Action Run
4 run-22 - 42257282852.4 06 Nov 2026 04:59PM UTC 126
77.51
GitHub Action Run
Source Files on build 42257282852
  • Tree
  • List 126
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 525e71d7 on github
  • Prev Build on master (#42239628995)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc