Daily Shaarli

All links of one day in a single page.

March 5, 2024

What tests you shouldn’t write for your software -- An essay on negative tests · Endless Parentheses

Interesting insight: A false failure is one that you fix by editing the test, while a real failure is one you fix by editing the code. Some tests virtually never have real failures, so it's better to avoid them. One principle is to test function, not code.

htmz - a low power tool for html

A clever way to implement a htmx-like mechanism of substituting the content of a node with the response of a request.

It works like this. Have a hidden iframe whose onload callback sets the target node (specified by hash) with the iframe's body content. Then use an a element to trigger the iframe load: <a target=_the_iframe href="/req-url#target-element">.

TIL: a[target], iframe[hidden], contentWindow, contentDocument, <base target=X>