Skip to content

Commit

Permalink
Adjust tests
Browse files Browse the repository at this point in the history
  • Loading branch information
f-elix committed Nov 28, 2024
1 parent fa4a9f5 commit 1f8deb5
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 9 deletions.
3 changes: 2 additions & 1 deletion packages/components/dismissable/vitest.config.js
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -10,6 +11,6 @@ export default mergeConfig(
setupFiles: ['./test/setup.ts'],
alias: [{ find: /^svelte$/, replacement: 'svelte/internal' }]
},
plugins: [sveltekit(), svelteInlineComponent()]
plugins: [sveltekit(), svelteTesting(), svelteInlineComponent()]
})
);
5 changes: 3 additions & 2 deletions packages/components/sprite-animation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
}
},
"peerDependencies": {
"svelte": "5.x",
"motion": "10.x"
"motion": "10.x",
"svelte": "5.x"
},
"dependencies": {
"@288-toolkit/device": "workspace:^",
Expand All @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
1 change: 1 addition & 0 deletions packages/components/sprite-animation/test/setup.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
import '@testing-library/jest-dom/vitest';
import '../../../../shared/test/mocks/sveltekit';
6 changes: 3 additions & 3 deletions packages/components/sprite-animation/vitest.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
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';

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()]
})
);
3 changes: 1 addition & 2 deletions packages/components/video-embed/vitest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()]
})
Expand Down
41 changes: 41 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1f8deb5

Please sign in to comment.