feat: add local Safari testing via safaridriver - #5131
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a custom Karma launcher to enable running the project’s unit tests locally in Safari via safaridriver, replacing the deprecated/broken third-party Safari launcher dependency.
Changes:
- Introduces
tests/karma.safari.cjs, a minimal W3C WebDriver client/launcher that spawnssafaridriverand navigates to the Karma URL. - Wires the custom launcher into the shared Karma config (
tests/karma.conf.base.cjs). - Removes
karma-safari-launcherfrom dependencies/lockfile.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| tests/karma.safari.cjs | New custom Safari launcher using safaridriver + Node http. |
| tests/karma.conf.base.cjs | Replaces karma-safari-launcher plugin with the local Safari launcher. |
| package.json | Drops karma-safari-launcher dependency. |
| pnpm-lock.yaml | Removes karma-safari-launcher entries. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a2c04c4 to
4f300a5
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot i think we should enable this by default to run alongside Chrome and Firefox, even if it’s more expensive to run on macOS in CI. We care that we don’t regress on WebKit/Safari so it’s worth it. |
Done in bd0debf — Safari is now enabled in CI on
|
|
@copilot Can you check and fix ci? |
Fixed in a7d2784. The CI failure had two root causes on cold macOS runners:
The |
|
@copilot Couple of lint errors to fix. See ci. |
Fixed in dab0d02 — two prettier formatting errors in
|
|
Seeing a lot ci fails @copilot. Do your thing, my good every so helpful little digital marvel. |
Fixed in ad409ca — two root causes identified from the Safari CI log:
|
|
@copilot can you review this again and fix any issues you find and any resolve any unresolved comments? |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (2)
pnpm-lock.yaml:129
- The lockfile no longer lists
lint-stagedunder the root importer’sdevDependencies, butpackage.jsonstill referencesnpx lint-stagedviasimple-git-hooksand includes alint-stagedconfig. This will causepnpm i --frozen-lockfileto omit lint-staged, breaking the configured pre-commit hook. Re-addlint-stagedto the root devDependencies (and regenerate the lockfile), or remove the hook/config if lint-staged is intentionally being dropped.
package.json:56 lint-stagedwas removed fromdevDependencies, but the repo still configuressimple-git-hooks.pre-committo runnpx lint-stagedand includes alint-stagedconfig block later in this same file. With this change, fresh installs won’t have lint-staged available locally, and pre-commit will either fail or unexpectedly download from the network. Either keeplint-stagedas a devDependency or remove/update thesimple-git-hooksandlint-stagedconfiguration to match.
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.2.0",
"karma-mocha-reporter": "^2.2.5",
"loading-indicator": "^2.0.0",
"pluralize": "^8.0.0",
"prettier": "^3.8.2",
"prompt": "^1.3.0",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 10 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
package.json:56
lint-stagedwas removed fromdevDependencies, butsimple-git-hooks.pre-commitstill runsnpx lint-stagedand thelint-stagedconfig remains in this file. This will make pre-commit either fail (no local binary) or rely on network installs vianpx. Re-addlint-stagedtodevDependencies(preferred) or update/remove the hook/config so it doesn't referencelint-staged.
"karma": "^6.4.4",
"karma-chrome-launcher": "^3.2.0",
"karma-firefox-launcher": "^2.1.3",
"karma-jasmine": "^5.1.0",
"karma-jasmine-html-reporter": "^2.2.0",
"karma-mocha-reporter": "^2.2.5",
"loading-indicator": "^2.0.0",
"pluralize": "^8.0.0",
"prettier": "^3.8.2",
"prompt": "^1.3.0",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed? |
Done in 039e560. All feedback is now addressed:
|
f6388e8 to
d5a21e6
Compare
|
@copilot can you fix the CI issues? |
Fixed in 9a55b96. The 4 Safari-specific test failures had the same root cause: Safari returns
|
|
@copilot still seeing issues? |
Fixed in 79aec16. The root cause was that The fix applies the same pattern: |
|
@copilot resolve the merge conflicts in this pull request |
Done — merged latest |
|
@copilot can you fix the lint issues? |
Fixed in the latest commit — removed the |
cdaf07b to
c48aea0
Compare
Adds a minimal custom karma launcher at
tests/karma.safari.cjssopnpm start --browser Safariworks locally and Safari can run in CI. It talks tosafaridriverover the WebDriver HTTP protocol directly, adding no dependency: the publishedkarma-safari-launcheruses aredirect.htmlhack that modern Safari treats as a download, and the@onslapreplacement needs a nativewd@1.xbuild that does not compile on Node 24+.Two fixes the Safari run surfaced:
core/pubsubhubposts to the parent frame withtargetOrigin: "/"rather than falling back to"*"when readingparent.location.originthrows on Safari's opaque srcdoc origin, and the unit test helper awaits the plugin document's own run promise instead of racing it.Written with AI: this change was generated by Claude. Per AI_POLICY.md.