mirror of
https://github.com/mermaid-js/mermaid-live-editor.git
synced 2025-03-18 17:16:21 +03:00
chore: Fix unit test
This commit is contained in:
@@ -27,14 +27,15 @@
|
|||||||
"@sveltejs/adapter-static": "3.0.6",
|
"@sveltejs/adapter-static": "3.0.6",
|
||||||
"@sveltejs/kit": "2.8.0",
|
"@sveltejs/kit": "2.8.0",
|
||||||
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
||||||
"@testing-library/svelte": "4.2.3",
|
"@testing-library/jest-dom": "^6.6.3",
|
||||||
|
"@testing-library/svelte": "^5.2.4",
|
||||||
"@types/dompurify": "^3.0.5",
|
"@types/dompurify": "^3.0.5",
|
||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/pako": "2.0.3",
|
"@types/pako": "2.0.3",
|
||||||
"@types/uuid": "9.0.8",
|
"@types/uuid": "9.0.8",
|
||||||
"@typescript-eslint/eslint-plugin": "6.21.0",
|
"@typescript-eslint/eslint-plugin": "6.21.0",
|
||||||
"@typescript-eslint/parser": "6.21.0",
|
"@typescript-eslint/parser": "6.21.0",
|
||||||
"@vitest/ui": "^1.1.3",
|
"@vitest/ui": "^2.1.4",
|
||||||
"autoprefixer": "^10.4.14",
|
"autoprefixer": "^10.4.14",
|
||||||
"c8": "7.14.0",
|
"c8": "7.14.0",
|
||||||
"chai": "^4.3.7",
|
"chai": "^4.3.7",
|
||||||
@@ -53,7 +54,7 @@
|
|||||||
"eslint-plugin-vitest": "^0.5.0",
|
"eslint-plugin-vitest": "^0.5.0",
|
||||||
"esserializer": "^1.3.11",
|
"esserializer": "^1.3.11",
|
||||||
"husky": "^8.0.3",
|
"husky": "^8.0.3",
|
||||||
"jsdom": "^21.1.2",
|
"jsdom": "^25.0.1",
|
||||||
"lint-staged": "^15.2.0",
|
"lint-staged": "^15.2.0",
|
||||||
"node-html-parser": "^6.1.5",
|
"node-html-parser": "^6.1.5",
|
||||||
"postcss": "^8.4.33",
|
"postcss": "^8.4.33",
|
||||||
@@ -67,7 +68,7 @@
|
|||||||
"tslib": "^2.6.2",
|
"tslib": "^2.6.2",
|
||||||
"typescript": "^5.5.0",
|
"typescript": "^5.5.0",
|
||||||
"vite": "^5.4.4",
|
"vite": "^5.4.4",
|
||||||
"vitest": "^1.1.3",
|
"vitest": "^2.1.4",
|
||||||
"vitest-dom": "^0.1.1"
|
"vitest-dom": "^0.1.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { cleanup, render } from '@testing-library/svelte';
|
import { cleanup, render } from '@testing-library/svelte';
|
||||||
import { describe, expect, it, afterEach } from 'vitest';
|
import { afterEach, describe, expect, it } from 'vitest';
|
||||||
import Card from './Card.svelte';
|
import Card from './Card.svelte';
|
||||||
|
|
||||||
describe('card.svelte', () => {
|
describe('card.svelte', () => {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'vitest-dom/extend-expect';
|
import '@testing-library/jest-dom/vitest';
|
||||||
import { beforeAll, vi } from 'vitest';
|
import { beforeAll, vi } from 'vitest';
|
||||||
|
import 'vitest-dom/extend-expect';
|
||||||
|
|
||||||
// TODO: Remove once https://github.com/sveltejs/kit/issues/6259 is closed.
|
// TODO: Remove once https://github.com/sveltejs/kit/issues/6259 is closed.
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { sveltekit } from '@sveltejs/kit/vite';
|
import { sveltekit } from '@sveltejs/kit/vite';
|
||||||
|
import { svelteTesting } from '@testing-library/svelte/vite';
|
||||||
import { defineConfig } from 'vitest/config';
|
import { defineConfig } from 'vitest/config';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [sveltekit()],
|
plugins: [sveltekit(), svelteTesting()],
|
||||||
envPrefix: 'MERMAID_',
|
envPrefix: 'MERMAID_',
|
||||||
optimizeDeps: { include: ['mermaid'] },
|
optimizeDeps: { include: ['mermaid'] },
|
||||||
server: {
|
server: {
|
||||||
|
|||||||
Reference in New Issue
Block a user