test.build/core/selectors/markup.selector.test.ts
test.build/core/selectors/markup.selector.test.ts is a file in Codebase Testing. 10 lines of code and 0 definitions.
import { describe, expect, it } from "vitest";
import { attributeOf } from "@banes-lab/build-scripts/core/selectors/markup.selector.ts";
import { parseTag } from "@banes-lab/build-scripts/core/converters/markup.converter.ts";
describe("attributeOf", () => {
it("picks a parsed attribute by name and nothing for one the tag does not carry", () => {
const tag = parseTag(`g class="node" data-id='a>b'`);
expect(attributeOf(tag, "data-id")?.value).toBe("a>b");
expect(attributeOf(tag, "style")).toBeUndefined();
});
});