char-slop/berry
multipurpose self-modifiable agentic harness
git clone https://git.t4t.associates/char-slop/berry
c5dd844
main
1import { assertEquals } from "@std/assert" ; 2import { withDom } from "@berry/util/dom.ts" ; 3import { syncRenderers } from "./renderers.ts" ; 4 5Deno . test ( "a frontend whose styles alone changed swaps its stylesheets without importing it again" , () => 6withDom ( async () => { 7const module = `data:text/javascript, ${ encodeURIComponent ( "export default { tools: {} };" )} ` ; 8const hrefs = () => 9[ ...document . head . querySelectorAll ( "link" )]. map (( link ) => link . getAttribute ( "href" )); 10try { 11assertEquals ( 12await syncRenderers ([{ name :"probe" , formerly :[], web :{ module, styles :[ "/a.css" ] } }]), 13true , 14); 15assertEquals ( hrefs (), [ "/a.css" ]); 16assertEquals ( 17await syncRenderers ([{ name :"probe" , formerly :[], web :{ module, styles :[ "/b.css" ] } }]), 18false , 19); 20assertEquals ( hrefs (), [ "/b.css" ]); 21} finally { 22await syncRenderers ([]); 23} 24}));