diff --git a/packages/components/dismissable/package.json b/packages/components/dismissable/package.json index d0d64025..e9fa7b11 100644 --- a/packages/components/dismissable/package.json +++ b/packages/components/dismissable/package.json @@ -40,6 +40,7 @@ }, "devDependencies": { "@testing-library/dom": "^10.4.0", + "@testing-library/jest-dom": "^6.6.3", "jsdom": "25.0.1", "svelte-preprocess": "6.0.3" } diff --git a/packages/components/dismissable/test/setup.ts b/packages/components/dismissable/test/setup.ts index 8167d143..1597d167 100644 --- a/packages/components/dismissable/test/setup.ts +++ b/packages/components/dismissable/test/setup.ts @@ -1 +1,2 @@ +import '@testing-library/jest-dom/vitest'; import '../../../../shared/test/mocks/sveltekit'; diff --git a/packages/components/dismissable/vitest.config.js b/packages/components/dismissable/vitest.config.js index d7b1f54a..d61884b8 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'; @@ -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/pnpm-lock.yaml b/pnpm-lock.yaml index ad87b921..00867ad8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1126,6 +1126,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'} @@ -1549,6 +1553,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'} @@ -1639,6 +1647,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'} @@ -4928,6 +4939,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 @@ -5028,6 +5044,8 @@ snapshots: mdn-data: 2.0.30 source-map-js: 1.2.1 + css.escape@1.5.1: {} + cssesc@3.0.0: {} cssstyle@4.1.0: