MCPcopy
hub / github.com/vitejs/vite / getNode

Function getNode

packages/vite/src/node/__tests__/assetSource.spec.ts:6–9  ·  view source on GitHub ↗
(html: string)

Source from the content-addressed store, hash-verified

4
5describe('getNodeAssetAttributes', () => {
6 const getNode = (html: string) => {
7 const ast = parseFragment(html, { sourceCodeLocationInfo: true })
8 return ast.childNodes[0] as DefaultTreeAdapterMap['element']
9 }
10
11 test('handles img src', () => {
12 const node = getNode('<img src="foo.jpg">')

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected