Fix CI JS corruption from obfuscator stdout; clean up flaky test guards #81

Merged
will.anderson merged 1 commits from fix/stage-ci-paths into dev 2026-05-11 14:16:31 +00:00
Owner

Summary

  • Root cause fix: elc --obfuscate prints a [javascript-obfuscator-cli] progress line to stdout. CI was redirecting all stdout directly to dist/js/${name}.js, prepending this non-JS line to every compiled file and causing browser parse errors on stage.
  • Redirect elc output to /tmp/_elc_out.js first, then sed strips [javascript-obfuscator lines before writing to dist/js/.
  • Remove spurious waitForFunction(signUpWithEmail) guards from buyer-name and buyer-email tests (pure DOM structural tests, no auth interaction).
  • Switch chat.spec.ts beforeEach from networkidle to domcontentloaded (SSR elements present at DOM ready; networkidle caused cold-start timeouts).

Test plan

  • CI full build compiles JS cleanly — no [javascript-obfuscator prefix in dist/js files
  • All mock Stripe tests pass (corrupted JS was preventing initStripe from loading)
  • buyer-name / buyer-email structural tests pass without auth guard
  • chat.spec.ts passes without networkidle timeout on cold start
## Summary - **Root cause fix**: `elc --obfuscate` prints a `[javascript-obfuscator-cli]` progress line to stdout. CI was redirecting all stdout directly to `dist/js/${name}.js`, prepending this non-JS line to every compiled file and causing browser parse errors on stage. - Redirect `elc` output to `/tmp/_elc_out.js` first, then `sed` strips `[javascript-obfuscator` lines before writing to `dist/js/`. - Remove spurious `waitForFunction(signUpWithEmail)` guards from `buyer-name` and `buyer-email` tests (pure DOM structural tests, no auth interaction). - Switch `chat.spec.ts` `beforeEach` from `networkidle` to `domcontentloaded` (SSR elements present at DOM ready; networkidle caused cold-start timeouts). ## Test plan - [ ] CI full build compiles JS cleanly — no `[javascript-obfuscator` prefix in `dist/js` files - [ ] All mock Stripe tests pass (corrupted JS was preventing `initStripe` from loading) - [ ] buyer-name / buyer-email structural tests pass without auth guard - [ ] chat.spec.ts passes without networkidle timeout on cold start
will.anderson added 1 commit 2026-05-11 13:20:08 +00:00
Fix CI JS corruption from obfuscator stdout; clean up flaky test guards
Dev — Build & local smoke test / build-smoke (pull_request) Successful in 1m54s
61f006f62d
- Strip [javascript-obfuscator-cli] progress line from elc --obfuscate
  output before writing to dist/js/ (was prepended to every compiled JS
  file, causing browser parse errors on stage)
- Remove spurious waitForFunction(signUpWithEmail) guards from
  buyer-name and buyer-email structural tests (pure DOM tests, no auth)
- Switch chat.spec.ts beforeEach to domcontentloaded (SSR elements
  present at DOM ready; networkidle caused cold-start timeouts)
will.anderson merged commit 91ecdaf3a5 into dev 2026-05-11 14:16:31 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: neuron-technologies/neuron-web#81