mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
fix(packages): add server-only bundles (#1349)
This commit is contained in:
@@ -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,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', () => {
|
||||
|
||||
Reference in New Issue
Block a user