mirror of
https://github.com/gromlab-ru/svg-sprites.git
synced 2026-07-22 04:40:17 +03:00
test: добавить площадку интеграционного тестирования
- добавлены consumer fixtures для React и Next.js - добавлены typecheck, production build и браузерные smoke-тесты - добавлена интеграционная проверка в CI
This commit is contained in:
25
integration/apps/sveltekit/package.json
Normal file
25
integration/apps/sveltekit/package.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "@svg-sprites-fixtures/sveltekit",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"sprites": "svg-sprites --mode legacy .",
|
||||
"typecheck": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"build": "npm run sprites && svelte-kit sync && vite build",
|
||||
"dev": "npm run sprites && vite dev",
|
||||
"start": "node build/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"svelte": "5.56.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gromlab/svg-sprites": "file:../../..",
|
||||
"@sveltejs/adapter-node": "5.5.7",
|
||||
"@sveltejs/kit": "2.69.2",
|
||||
"@sveltejs/vite-plugin-svelte": "7.2.0",
|
||||
"svelte-check": "4.7.2",
|
||||
"typescript": "6.0.2",
|
||||
"vite": "8.1.4"
|
||||
}
|
||||
}
|
||||
11
integration/apps/sveltekit/src/app.html
Normal file
11
integration/apps/sveltekit/src/app.html
Normal file
@@ -0,0 +1,11 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
%sveltekit.head%
|
||||
</head>
|
||||
<body data-sveltekit-preload-data="hover">
|
||||
<div style="display: contents">%sveltekit.body%</div>
|
||||
</body>
|
||||
</html>
|
||||
34
integration/apps/sveltekit/src/routes/+page.svelte
Normal file
34
integration/apps/sveltekit/src/routes/+page.svelte
Normal file
@@ -0,0 +1,34 @@
|
||||
<svelte:head>
|
||||
<title>SvelteKit sprite fixture</title>
|
||||
</svelte:head>
|
||||
|
||||
<main>
|
||||
<h1>SvelteKit</h1>
|
||||
<svg
|
||||
data-testid="icon"
|
||||
data-app="sveltekit"
|
||||
aria-label="Check icon"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
<use href="/sprites/icons.sprite.svg#check"></use>
|
||||
</svg>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
:global(:root) {
|
||||
font-family: system-ui, sans-serif;
|
||||
color: #172033;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
:global(body) {
|
||||
margin: 0;
|
||||
padding: 40px;
|
||||
}
|
||||
|
||||
[data-testid='icon'] {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
color: #16a34a;
|
||||
}
|
||||
</style>
|
||||
7
integration/apps/sveltekit/svelte.config.js
Normal file
7
integration/apps/sveltekit/svelte.config.js
Normal file
@@ -0,0 +1,7 @@
|
||||
import adapter from '@sveltejs/adapter-node'
|
||||
|
||||
export default {
|
||||
kit: {
|
||||
adapter: adapter(),
|
||||
},
|
||||
}
|
||||
11
integration/apps/sveltekit/svg-sprites.config.ts
Normal file
11
integration/apps/sveltekit/svg-sprites.config.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export default {
|
||||
output: 'static/sprites',
|
||||
preview: false,
|
||||
sprites: [
|
||||
{
|
||||
name: 'icons',
|
||||
input: '../../fixtures/icons',
|
||||
format: 'symbol',
|
||||
},
|
||||
],
|
||||
}
|
||||
14
integration/apps/sveltekit/tsconfig.json
Normal file
14
integration/apps/sveltekit/tsconfig.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"extends": "./.svelte-kit/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"checkJs": true,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"skipLibCheck": true,
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"moduleResolution": "Bundler"
|
||||
}
|
||||
}
|
||||
6
integration/apps/sveltekit/vite.config.ts
Normal file
6
integration/apps/sveltekit/vite.config.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { sveltekit } from '@sveltejs/kit/vite'
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [sveltekit()],
|
||||
})
|
||||
Reference in New Issue
Block a user