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:
@@ -1,11 +1,7 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { safeDefine } from '../safe-define';
|
||||
|
||||
describe('safeDefine', () => {
|
||||
afterEach(() => {
|
||||
vi.unstubAllGlobals();
|
||||
});
|
||||
|
||||
it('registers a custom element', () => {
|
||||
class TestElement extends HTMLElement {
|
||||
static tagName = 'test-sd-register';
|
||||
@@ -37,14 +33,4 @@ describe('safeDefine', () => {
|
||||
safeDefine(Replacement);
|
||||
expect(customElements.get('test-sd-no-replace')).toBe(Original);
|
||||
});
|
||||
|
||||
it('does nothing when customElements is unavailable', () => {
|
||||
vi.stubGlobal('customElements', undefined);
|
||||
|
||||
class TestElement extends HTMLElement {
|
||||
static tagName = 'test-sd-ssr';
|
||||
}
|
||||
|
||||
expect(() => safeDefine(TestElement)).not.toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user