mirror of https://github.com/buster-so/buster.git
Merge pull request #1036 from buster-so/nate/unit-tests-hot-fix
mock env variables
This commit is contained in:
commit
077606a625
|
@ -1,9 +1,24 @@
|
|||
import type { Value } from 'platejs';
|
||||
import { createPlateEditor } from 'platejs/react';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { EditorKit } from '../../editor-kit';
|
||||
import { markdownToPlatejs, platejsToMarkdown } from './platejs-conversions';
|
||||
|
||||
vi.mock('@/env', () => ({
|
||||
env: {
|
||||
VITE_PUBLIC_ENABLE_TANSTACK_PANEL: 'true',
|
||||
VITE_PUBLIC_POSTHOG_HOST: 'https://example.com',
|
||||
VITE_PUBLIC_POSTHOG_KEY: '1234567890',
|
||||
VITE_PUBLIC_URL: 'https://example.com',
|
||||
VITE_PUBLIC_SUPABASE_ANON_KEY: '1234567890',
|
||||
VITE_PUBLIC_SUPABASE_URL: 'https://example.com',
|
||||
VITE_PUBLIC_WS_URL: 'https://example.com',
|
||||
VITE_PUBLIC_WEB_SOCKET_URL: 'https://example.com',
|
||||
VITE_PUBLIC_API2_URL: 'https://example.com',
|
||||
VITE_PUBLIC_API_URL: 'https://example.com',
|
||||
},
|
||||
}));
|
||||
|
||||
export const editor = createPlateEditor({
|
||||
plugins: EditorKit({ scrollAreaRef: undefined, mode: 'default' }),
|
||||
});
|
||||
|
|
|
@ -1,22 +1,12 @@
|
|||
import { MediaPluginOptions } from '@platejs/media';
|
||||
import {
|
||||
AudioPlugin,
|
||||
FilePlugin,
|
||||
ImagePlugin,
|
||||
MediaEmbedPlugin,
|
||||
PlaceholderPlugin,
|
||||
VideoPlugin,
|
||||
} from '@platejs/media/react';
|
||||
import { KEYS } from 'platejs';
|
||||
import { CUSTOM_KEYS } from '../config/keys';
|
||||
import { AudioElement } from '../elements/AudioNode';
|
||||
import { MediaEmbedElement } from '../elements/MediaEmbedNode';
|
||||
import { FileElement } from '../elements/MediaFileNode';
|
||||
import { ImageElement } from '../elements/MediaImageNode';
|
||||
import { PlaceholderElement } from '../elements/MediaPlaceholderElement';
|
||||
import { MediaPreviewDialog } from '../elements/MediaPreviewDialog';
|
||||
import { MediaUploadToast } from '../elements/MediaUploadToast';
|
||||
import { VideoElement } from '../elements/MediaVideoNode';
|
||||
|
||||
export const MediaKit = [
|
||||
ImagePlugin.configure({
|
||||
|
|
Loading…
Reference in New Issue