# test.build/core/selectors/markup.selector.test.ts

> 10 lines of code and 0 definitions.

Tree: Codebase Testing
Language: typescript
Canonical: https://banes-lab.com/anatomy/testing#file-testing-test-build-core-selectors-markup-selector-test-ts
Source text: https://banes-lab.com/source/testing/test.build/core/selectors/markup.selector.test.ts.txt

Listed in [test.build/core/selectors](https://banes-lab.com/api/source/testing/test.build/core/selectors.md), after [test.build/core/selectors/catalog.selector.test.ts](https://banes-lab.com/source/testing/test.build/core/selectors/catalog.selector.test.ts.md) and before [test.build/core/selectors/page.selector.test.ts](https://banes-lab.com/source/testing/test.build/core/selectors/page.selector.test.ts.md).

## Contained in

- [test.build/core/selectors](https://banes-lab.com/anatomy/testing/folder-testing-test-build-core-selectors.md)

## Source

```typescript
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();
    });
});
```
