const test = require('node:test'); const assert = require('node:assert/strict'); const { loader } = require('./helpers/load-typescript.cjs'); function renderSource(svg) { let source; const { rasterizeSvg } = loader({}, { './ios-graphics': { rasterizeSvg: (value, size) => { source = value; assert.equal(size, 32); return 'rendered'; }, } })('app/native/svg-rasterizer.ios.ts'); assert.equal(rasterizeSvg(svg, 32, 2), 'rendered'); return source; } test('EvenHub currentColor SVG fills are resolved before handing them to SVGKit', () => { // Same document shape as the Snake and Weather store icons copied from the phone. const source = renderSource(''); assert.match(source, /fill="#ffffff"/); assert.doesNotMatch(source, /currentColor/i); assert.equal((source.match(/fill=/g) || []).length, 1); assert.match(source, /viewBox="0 0 24 24"/); }); test('currentColor strokes/styles resolve without filling open Lucide shapes', () => { const source = renderSource(''); assert.match(source, /fill="none"/); assert.match(source, /stroke="#ffffff"/); assert.match(source, /style="stroke:#ffffff"/); assert.match(source, /stroke-linecap="round"/); });