diff --git a/packages/components/dismissable/vitest.config.js b/packages/components/dismissable/vitest.config.js index d7b1f54a..bb9613a1 100644 --- a/packages/components/dismissable/vitest.config.js +++ b/packages/components/dismissable/vitest.config.js @@ -1,5 +1,6 @@ import { svelteInlineComponent } from '@288-toolkit/vite-plugin-svelte-inline-component'; import { sveltekit } from '@sveltejs/kit/vite'; +import { svelteTesting } from '@testing-library/svelte/vite'; import { defineProject, mergeConfig } from 'vitest/config'; import baseConfig from '../../../vitest.shared'; @@ -10,6 +11,6 @@ export default mergeConfig( setupFiles: ['./test/setup.ts'], alias: [{ find: /^svelte$/, replacement: 'svelte/internal' }] }, - plugins: [sveltekit(), svelteInlineComponent()] + plugins: [sveltekit(), svelteTesting(), svelteInlineComponent()] }) ); diff --git a/packages/components/sprite-animation/package.json b/packages/components/sprite-animation/package.json index 31809129..e879aac7 100644 --- a/packages/components/sprite-animation/package.json +++ b/packages/components/sprite-animation/package.json @@ -28,8 +28,8 @@ } }, "peerDependencies": { - "svelte": "5.x", - "motion": "10.x" + "motion": "10.x", + "svelte": "5.x" }, "dependencies": { "@288-toolkit/device": "workspace:^", @@ -38,6 +38,7 @@ }, "devDependencies": { "@288-toolkit/vite-plugin-svelte-inline-component": "workspace:^", + "@testing-library/jest-dom": "^6.6.3", "@testing-library/svelte": "^5.1.0", "svelte-preprocess": "^6.0.0" } diff --git a/packages/components/sprite-animation/test/SpriteAnimation.spec.ts b/packages/components/sprite-animation/test/SpriteAnimation.spec.ts index 98120586..a2ac0491 100644 --- a/packages/components/sprite-animation/test/SpriteAnimation.spec.ts +++ b/packages/components/sprite-animation/test/SpriteAnimation.spec.ts @@ -1,4 +1,4 @@ -import { render } from '@testing-library/svelte'; +import { render } from '@testing-library/svelte/svelte5'; import { afterEach, beforeEach, expect, test, vi } from 'vitest'; import SpriteAnimation from '../src/lib/SpriteAnimation.svelte'; diff --git a/packages/components/sprite-animation/test/setup.ts b/packages/components/sprite-animation/test/setup.ts index 8167d143..1597d167 100644 --- a/packages/components/sprite-animation/test/setup.ts +++ b/packages/components/sprite-animation/test/setup.ts @@ -1 +1,2 @@ +import '@testing-library/jest-dom/vitest'; import '../../../../shared/test/mocks/sveltekit'; diff --git a/packages/components/sprite-animation/vitest.config.js b/packages/components/sprite-animation/vitest.config.js index d7b1f54a..d61884b8 100644 --- a/packages/components/sprite-animation/vitest.config.js +++ b/packages/components/sprite-animation/vitest.config.js @@ -1,5 +1,6 @@ import { svelteInlineComponent } from '@288-toolkit/vite-plugin-svelte-inline-component'; import { sveltekit } from '@sveltejs/kit/vite'; +import { svelteTesting } from '@testing-library/svelte/vite'; import { defineProject, mergeConfig } from 'vitest/config'; import baseConfig from '../../../vitest.shared'; @@ -7,9 +8,8 @@ export default mergeConfig( baseConfig, defineProject({ test: { - setupFiles: ['./test/setup.ts'], - alias: [{ find: /^svelte$/, replacement: 'svelte/internal' }] + setupFiles: ['./test/setup.ts'] }, - plugins: [sveltekit(), svelteInlineComponent()] + plugins: [sveltekit(), svelteTesting(), svelteInlineComponent()] }) ); diff --git a/packages/components/video-embed/vitest.config.js b/packages/components/video-embed/vitest.config.js index d7b1f54a..a3142ae0 100644 --- a/packages/components/video-embed/vitest.config.js +++ b/packages/components/video-embed/vitest.config.js @@ -7,8 +7,7 @@ export default mergeConfig( baseConfig, defineProject({ test: { - setupFiles: ['./test/setup.ts'], - alias: [{ find: /^svelte$/, replacement: 'svelte/internal' }] + setupFiles: ['./test/setup.ts'] }, plugins: [sveltekit(), svelteInlineComponent()] }) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4563eaef..bc60fb6b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -311,6 +311,9 @@ importers: '@288-toolkit/vite-plugin-svelte-inline-component': specifier: workspace:^ version: link:../../vite-plugin-svelte-inline-component + '@testing-library/jest-dom': + specifier: ^6.6.3 + version: 6.6.3 '@testing-library/svelte': specifier: ^5.1.0 version: 5.1.0(svelte@5.2.10)(vite@5.2.11(@types/node@20.12.7))(vitest@2.1.6(@types/node@20.12.7)(jsdom@24.0.0)) @@ -638,6 +641,9 @@ packages: resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} engines: {node: '>=0.10.0'} + '@adobe/css-tools@4.4.1': + resolution: {integrity: sha512-12WGKBQzjUAI4ayyF4IAtfw2QR/IDoqk6jTddXDhtYTJF9ASmoE1zst7cVtP0aL/F1jUJL5r+JxKXKEgHNbEUQ==} + '@ampproject/remapping@2.3.0': resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} @@ -1146,6 +1152,10 @@ packages: resolution: {integrity: sha512-FlS4ZWlp97iiNWig0Muq8p+3rVDjRiYE+YKGbAqXOu9nwJFFOdL00kFpz42M+4huzYi86vAK1sOOfyOG45muIQ==} engines: {node: '>=14'} + '@testing-library/jest-dom@6.6.3': + resolution: {integrity: sha512-IteBhl4XqYNkM54f4ejhLRJiZNqcSCoXUOG2CPK7qbD322KjQozM4kHQOfkG2oln9b9HTYqs+Sae8vBATubxxA==} + engines: {node: '>=14', npm: '>=6', yarn: '>=1'} + '@testing-library/svelte@5.1.0': resolution: {integrity: sha512-8GW+rBR72U7Qql0Glxl4CtVTr6GPotYf/MB7MamIH6ZpV45i7IJIOm3oHWH4Wr6ZULdUs37F9recegQygLbC0g==} engines: {node: '>= 10'} @@ -1547,6 +1557,10 @@ packages: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} + chalk@3.0.0: + resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} + engines: {node: '>=8'} + chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -1629,6 +1643,9 @@ packages: resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} + css.escape@1.5.1: + resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} + cssesc@3.0.0: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} @@ -1757,6 +1774,9 @@ packages: dom-accessibility-api@0.5.16: resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} + dom-accessibility-api@0.6.3: + resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==} + electron-to-chromium@1.4.730: resolution: {integrity: sha512-oJRPo82XEqtQAobHpJIR3zW5YO3sSRRkPz2an4yxi1UvqhsGm54vR/wzTFV74a3soDOJ8CKW7ajOOX5ESzddwg==} @@ -3687,6 +3707,8 @@ snapshots: '@aashutoshrathi/word-wrap@1.2.6': {} + '@adobe/css-tools@4.4.1': {} + '@ampproject/remapping@2.3.0': dependencies: '@jridgewell/gen-mapping': 0.3.5 @@ -4434,6 +4456,16 @@ snapshots: lz-string: 1.5.0 pretty-format: 27.5.1 + '@testing-library/jest-dom@6.6.3': + dependencies: + '@adobe/css-tools': 4.4.1 + aria-query: 5.3.2 + chalk: 3.0.0 + css.escape: 1.5.1 + dom-accessibility-api: 0.6.3 + lodash: 4.17.21 + redent: 3.0.0 + '@testing-library/svelte@5.1.0(svelte@4.2.12)(vite@5.2.11(@types/node@20.12.7))(vitest@2.1.6(@types/node@20.12.7)(jsdom@24.0.0))': dependencies: '@testing-library/dom': 9.3.4 @@ -4921,6 +4953,11 @@ snapshots: escape-string-regexp: 1.0.5 supports-color: 5.5.0 + chalk@3.0.0: + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + chalk@4.1.2: dependencies: ansi-styles: 4.3.0 @@ -5015,6 +5052,8 @@ snapshots: mdn-data: 2.0.30 source-map-js: 1.2.0 + css.escape@1.5.1: {} + cssesc@3.0.0: {} cssstyle@4.0.1: @@ -5141,6 +5180,8 @@ snapshots: dom-accessibility-api@0.5.16: {} + dom-accessibility-api@0.6.3: {} + electron-to-chromium@1.4.730: {} emoji-regex@8.0.0: {}