Back to the radar AI-Assisted Development

Your unit tests are paying an unnecessary DOM tax

Open the test configuration of almost any front-end project and you’ll find one line that decides more about your CI bill than most of the code around it: environment: 'jsdom'. Unit and component tests for React, Vue, Angular, Svelte, and Solid apps rarely run in a real browser.

Open the test configuration of almost any front-end project and you’ll find one line that decides more about your CI bill than most of the code around it: environment: 'jsdom'. Unit and component tests for React, Vue, Angular, Svelte, and Solid apps rarely run in a real browser.

For most teams that library is jsdom, the long-standing, standards-minded default. A growing number use happy-dom, which is faster but less faithful. Few teams think about the choice again after the first npm install. They should, because the test DOM is often where a component suite spends a large share of its time, and because the two popular options force a trade that most teams don’t know they’re making.

Over the past months I measured this on real projects. Here is what I found, and what I built as a result.

A component test does very little work of its own. It creates elements, sets attributes, dispatches events, and reads back state. Every one of those steps is a call into the DOM implementation, and DOM APIs are chatty: a single high-level call can fan out into hundreds of internal ones.

To see how chatty, I built an open-source tracer, dom-api-tracer, that records which DOM APIs a test suite calls and how often. One example from those traces: a single getComputedStyle() call in jsdom triggered about 1,000 reads of Node and Element properties inside the library, because resolving styles means matching selectors against the tree. Testing libraries call getComputedStyle() constantly, for instance to decide whether an element is visible.

Multiply that by tens of thousands of tests and the DOM is no longer a detail. On Ant Design’s suite of React components, swapping the DOM implementation alone took a CI run from about 30 minutes to 6.7 minutes. Nothing else changed: same tests, same runner, same machine.

In context

  • Topic: Desarrollo con IA — Copilotos y agentes en el ciclo de desarrollo de software.
  • Source: InfoWorld
  • Published: 23/11/2026

Continue reading at the original source →

Excerpt published automatically by the site radar. The full text belongs to its publisher and is linked above.

Why it matters

When a tool appears promising faster development, the useful question is not how much code it generates but how much work it generates downstream. Tests, review, security, technical debt, incidents: that is where the promise gets paid or charged.

I look at it from operations, not from the demo. The question is not whether the assistant writes a correct function, but whether the team can maintain what it produced six months later, with different people, without the original context. That is the real test and it almost never appears in the announcements.

What usually goes wrong

The problem appears when somebody accepts code they do not fully understand but which passes the tests. It works, it ships, and six months later it needs changing. That is when you discover nobody on the team can explain why it is written that way, and the small change becomes a rewrite.

What to watch

  • What happens to tests — generating code without generating tests only moves the problem forward.
  • Where the source code travels when the assistant is used, and what the contract says about it.
  • The effect on people newly joining the team, which is where judgement erodes fastest.

How I read this entry

What I would ask to measure is not lines or accepted suggestions, but defects reaching production and review time per change. If those two go down, the tool works. If they go up while speed goes up, debt is being accumulated and it gets paid in incidents.

This entry is an excerpt from the original source, selected by the site radar. The commentary above is the site's own and does not belong to the cited publisher.
Share

Comments

No comments yet. Yours can be the first.

Plain text only, no links. No email is requested. Comments are reviewed before they are published.

Living through this in your own team?

Open the chat and tell me how you're handling it. I'm interested in comparing notes.

Keep reading

More entries from the radar

See all
Darinel Ortega Online · I reply during the day
Today
Hello. I'm not selling anything here: this is for exchanging knowledge about technology.
Write whatever you like — you can send text, images or documents. Messages reach my console and I reply from there.
You are writing outside working hours. I will read you as soon as the day starts.

An open conversation to share knowledge. Messages reach my console and I reply from there.

Let us book a conversation

Pick the day and time that work for you. Thirty minutes, no sales pitch.

Video call

For a video call, just ask for one here and I'll send you the session link.