You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+10-13Lines changed: 10 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,14 +21,13 @@ This package implements the (currently experimental) browser-provider contract e
21
21
A few couplings are intentional and accepted as compatibility risks rather than worked around:
22
22
23
23
- the provider augments `vitest/node` and `vitest/browser` via `declare module`;
24
-
- it reads `project.vitest.state._data` and `config.teardownTimeout` to extend the WebDriver shutdown timeout;
25
-
- the locator engine assigns `__INTERNAL._createLocator` from `vitest/internal/browser`.
24
+
- the locator engine assigns `__INTERNAL._createLocator` from `vitest/internal/browser`. That export is stripped from the published type declarations, so the import carries a `@ts-expect-error`.
26
25
27
-
These resolve against whichever Vitest version the consumer installs. When upgrading the supported Vitest version, bump this package to match and re-run the smoke suite.
26
+
These resolve against whichever Vitest version the consumer installs. When upgrading the supported Vitest version, bump this package to match and re-run the test suite.
28
27
29
-
### Types vs JS
28
+
### Types
30
29
31
-
The provider source imports a handful of symbols (`page`, `server`, `utils`, `Locator`, `ScreenshotMatcherOptions`, …) from `vitest/browser`. Those are only re-exported by `vitest/browser` when a browser-provider context is installed alongside it, so a standalone `pnpm typecheck`will report unresolved members. **The JS build is the contract** — `pnpm build` is the source of truth and CI treats `typecheck` as informational (`continue-on-error`). To get a fully green typecheck/test run, develop against a matching Vitest (see below).
30
+
`vitest/browser` only re-exports the browser context types (`page`, `server`, `utils`, `Locator`, `ScreenshotMatcherOptions`, …) through an installed provider package. Because the provider under development is the repo root and not in `node_modules`, [`tsconfig.json`](./tsconfig.json) maps `@vitest/browser-webdriverio` and `@vitest/browser-webdriverio/context` back to the local source via `paths`, so `pnpm typecheck`resolves those symbols through this package's own context. The only remaining gap is the intentionally-untyped `__INTERNAL` import (see above). Note: if a future Vitest release adds `__INTERNAL` to the published types, the `@ts-expect-error` becomes an unused directive and must be dropped.
32
31
33
32
## Developing against an unreleased Vitest
34
33
@@ -42,17 +41,17 @@ overrides:
42
41
43
42
Do not commit the override. It is only for local development before a matching beta is published.
44
43
45
-
## Smoke tests
44
+
## Tests
46
45
47
46
The suite in [`test/`](./test) is deliberately small. It does not re-test Vitest browser-mode behavior (that is Vitest's responsibility); it proves the WebdriverIO provider implements the contract and that its commands/locators/CDP/screenshots work against a real driver.
48
47
49
48
```sh
50
49
# requires a local Chrome + chromedriver
51
-
pnpm test:smoke
50
+
pnpm test
52
51
53
52
# pick a browser / run headed
54
-
BROWSER=firefox pnpm test:smoke
55
-
HEADLESS=false pnpm test:smoke
53
+
BROWSER=firefox pnpm test
54
+
HEADLESS=false pnpm test
56
55
```
57
56
58
57
In CI the [`setup-webdriverio`](./.github/actions/setup-webdriverio) action installs Chrome/ChromeDriver (and optionally Firefox) and exports `CHROME_BIN` / `CHROMEDRIVER_PATH` / `FIREFOX_BIN`, which [`vitest.config.ts`](./vitest.config.ts) feeds to WebdriverIO so it does not auto-download a mismatched driver.
@@ -63,7 +62,5 @@ Releases mirror the Vitest pipeline:
63
62
64
63
1. Run the **Prepare Publish** workflow (`workflow_dispatch`). It bumps the version with `bumpp` and opens a `chore: release vX.Y.Z` PR.
65
64
2. Merge the PR. The **Publish Package** workflow detects the release commit, builds, publishes to npm via trusted publishing, pushes the `vX.Y.Z` tag, and generates a GitHub release with `changelogithub`.
66
-
67
-
Versioning policy: keep the version inside the current Vitest beta range (`5.0.0-beta.x`) and move the `vitest` peer range to `^5` once Vitest 5 is stable.
68
-
69
-
> The release workflows still reference the `vitest-release-bot[bot]` identity and the `RELEASE_GITHUB_APP_*` / npm trusted-publishing secrets. Update the bot identity and configure the secrets/`Release` environment for this repository before the first release.
65
+
3. Approve the Release workflow in GitHub Actions.
Copy file name to clipboardExpand all lines: README.md
+1-5Lines changed: 1 addition & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,13 +48,9 @@ Then run Vitest in the browser mode:
48
48
npx vitest --browser
49
49
```
50
50
51
-
## Compatibility
52
-
53
-
This provider builds against the published `vitest` and `@vitest/browser` packages and tracks the same major version line. The `peerDependencies` range is kept deliberately tight because the browser-provider API is still marked experimental upstream. When upgrading Vitest, upgrade this package to the matching version.
54
-
55
51
## Contributing
56
52
57
-
See [CONTRIBUTING.md](./CONTRIBUTING.md) for local development, the build setup, the smoke test suite, and the release process.
53
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for local development, the build setup, the test suite, and the release process.
0 commit comments