UNPKG

@shopify/theme-language-server-common

Version:

<h1 align="center" style="position: relative;" > <br> <img src="https://github.com/Shopify/theme-check-vscode/blob/main/images/shopify_glyph.png?raw=true" alt="logo" width="141" height="160"> <br> Theme Language Server </h1>

29 lines (24 loc) 1.16 kB
import { describe, beforeEach, it, expect } from 'vitest'; import { DocumentManager } from '../../documents'; import { HoverProvider } from '../HoverProvider'; describe('Module: HtmlAttributeHoverProvider', async () => { let provider: HoverProvider; beforeEach(async () => { provider = new HoverProvider(new DocumentManager(), { filters: async () => [], objects: async () => [], tags: async () => [], systemTranslations: async () => ({}), }); }); it('should return the hover description of the attribute', async () => { await expect(provider).to.hover(`<img loading="lazy█">`, expect.stringMatching(/##* lazy/)); await expect(provider).to.hover(`<img loading='lazy█'>`, expect.stringMatching(/##* lazy/)); await expect(provider).to.hover(`<img loading=lazy█>`, expect.stringMatching(/##* lazy/)); }); it('should return nothing if the thing is unknown', async () => { await expect(provider).to.hover(`<img loading="unknown█">`, null); await expect(provider).to.hover(`<img loading='unknown█'>`, null); await expect(provider).to.hover(`<img loading=unknown█>`, null); }); });