Rewrite tests in Puppeteer#5
Conversation
|
OK, I think this is the way forward. Pinning to |
DeeDeeG
left a comment
There was a problem hiding this comment.
abandoned project like PhantomJS
Sad but true. I can see why a PR such as this is necessary.
As long as the tests pass without changing the logic of the tests themselves, as appears to be the case from looking at all the CI jobs for this PR, this looks fine to me!
Pinning to
All too true, once again. |
2ba980f to
8809c24
Compare
I initially skimmed the explanation and missed that Claude did the first pass of this, but
This is the crucial part as far as I'm concerned, and what I was looking for by reading the CI jobs' test step outputs, I'm glad you went further and tried breaking some tests to confirm they would actually show as failed, just to be sure, given AI's ability to be wrong plenty of the time. But yeah, the resulting code looks reasonable and not more complex than the PhantomJS version, so. Seems fine even knowing Claude did the first pass. It's honestly kind of wild how far AI coding tools have come, probably further than most of the generative stuff, but even stuff like photo generation is getting annoyingly close to fully believable, hard to detect right away. (At least the stuff that falls on the more believable end.) That's a tangent for another time, though, I guess. |
|
Noting my results before locally:
(Same results "before" this PR, in #4's CI: https://github.com/pulsar-edit/document-register-element/actions/runs/26725047579/job/78762282243) vs after this PR (CI):
Hmmm, three new individual tests? Also, I think this Chromium might be too new for my aging macOS Catalina locally? :| % npm test
> @pulsar-edit/document-register-element@1.15.3 test
> node testrunner.js
/Users/USER/document-register-element/node_modules/@puppeteer/browsers/lib/cjs/launch.js:350
reject(new Error([
^
Error: Failed to launch the browser process: Code: null
stderr:
dlopen /Users/USER/.cache/puppeteer/chrome/mac-148.0.7778.97/chrome-mac-x64/Google Chrome for Testing.app/Contents/MacOS/../Frameworks/Google Chrome for Testing Framework.framework/Versions/148.0.7778.97/Google Chrome for Testing Framework: dlopen(/Users/USER/.cache/puppeteer/chrome/mac-148.0.7778.97/chrome-mac-x64/Google Chrome for Testing.app/Contents/MacOS/../Frameworks/Google Chrome for Testing Framework.framework/Versions/148.0.7778.97/Google Chrome for Testing Framework, 261): Library not loaded: /System/Library/Frameworks/AVFAudio.framework/Versions/A/AVFAudio
Referenced from: /Users/USER/.cache/puppeteer/chrome/mac-148.0.7778.97/chrome-mac-x64/Google Chrome for Testing.app/Contents/Frameworks/Google Chrome for Testing Framework.framework/Versions/148.0.7778.97/Google Chrome for Testing Framework
Reason: image not found.
TROUBLESHOOTING: https://pptr.dev/troubleshooting
at ChildProcess.onClose (/Users/USER/document-register-element/node_modules/@puppeteer/browsers/lib/cjs/launch.js:350:24)
at ChildProcess.emit (node:events:536:35)
at ChildProcess._handle.onexit (node:internal/child_process:293:12)
Node.js v20.20.2https://developer.apple.com/documentation/avfaudio
Yep! |
Running
npm testsucceeds on my machine, but fails in CI becauseubuntu-latestuses an OpenSSL that is too new for an abandoned project like PhantomJS. Luckily, Claude is good at rewriting stuff in new stuff, so I had it take a pass and then fixed a couple things that were broken.This can possibly be fixed in the short term by pinning to
ubuntu-20.04, but that will only kick the can down the road.I've verified that this does what we expect, and that I can make a test fail by going into the relevant file and changing the spec expectation (so it's not just passing a bunch of tests by default).