fix(packages): add server-only bundles (#1349)

This commit is contained in:
rahim
2026-04-16 00:59:14 -07:00
committed by GitHub
parent 4ecc870685
commit 3331fdaf25
60 changed files with 654 additions and 215 deletions
@@ -77,7 +77,6 @@ describe('applyShadowStyles', () => {
describe('ensureGlobalStyle', () => {
afterEach(() => {
vi.unstubAllGlobals();
document.head.innerHTML = '';
});
@@ -96,9 +95,4 @@ describe('ensureGlobalStyle', () => {
expect(document.querySelectorAll('#test-dedup').length).toBe(1);
expect(document.getElementById('test-dedup')!.textContent).toBe('a { color: red; }');
});
it('does nothing when document is unavailable', () => {
vi.stubGlobal('document', undefined);
expect(() => ensureGlobalStyle('ssr', 'body {}')).not.toThrow();
});
});
+1 -10
View File
@@ -1,11 +1,7 @@
import { afterEach, describe, expect, it, vi } from 'vitest';
import { describe, expect, it } from 'vitest';
import { createTemplate, renderTemplate } from '../template';
describe('createTemplate', () => {
afterEach(() => {
vi.unstubAllGlobals();
});
it('returns an HTMLTemplateElement with parsed content', () => {
const template = createTemplate('<div class="root"><span>Hello</span></div>');
@@ -13,11 +9,6 @@ describe('createTemplate', () => {
expect(template!.content.querySelector('.root')).toBeTruthy();
expect(template!.content.querySelector('span')!.textContent).toBe('Hello');
});
it('returns null when document is unavailable', () => {
vi.stubGlobal('document', undefined);
expect(createTemplate('<div></div>')).toBeNull();
});
});
describe('renderTemplate', () => {