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:
12
integration/apps/svelte-vite/index.html
Normal file
12
integration/apps/svelte-vite/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Svelte Vite sprite fixture</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
22
integration/apps/svelte-vite/package.json
Normal file
22
integration/apps/svelte-vite/package.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "@svg-sprites-fixtures/svelte-vite",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"sprites": "svg-sprites --mode legacy .",
|
||||
"typecheck": "svelte-check --tsconfig ./tsconfig.json",
|
||||
"build": "npm run sprites && svelte-check --tsconfig ./tsconfig.json && vite build",
|
||||
"dev": "npm run sprites && vite"
|
||||
},
|
||||
"dependencies": {
|
||||
"svelte": "5.56.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gromlab/svg-sprites": "file:../../..",
|
||||
"@sveltejs/vite-plugin-svelte": "7.2.0",
|
||||
"svelte-check": "4.7.2",
|
||||
"typescript": "6.0.2",
|
||||
"vite": "8.1.4"
|
||||
}
|
||||
}
|
||||
30
integration/apps/svelte-vite/src/App.svelte
Normal file
30
integration/apps/svelte-vite/src/App.svelte
Normal file
@@ -0,0 +1,30 @@
|
||||
<main>
|
||||
<h1>Svelte + Vite</h1>
|
||||
<svg
|
||||
data-testid="icon"
|
||||
data-app="svelte-vite"
|
||||
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>
|
||||
6
integration/apps/svelte-vite/src/app.d.ts
vendored
Normal file
6
integration/apps/svelte-vite/src/app.d.ts
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
declare module '*.svelte' {
|
||||
import type { Component } from 'svelte'
|
||||
|
||||
const component: Component<Record<string, never>>
|
||||
export default component
|
||||
}
|
||||
7
integration/apps/svelte-vite/src/main.ts
Normal file
7
integration/apps/svelte-vite/src/main.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { mount } from 'svelte'
|
||||
|
||||
import App from './App.svelte'
|
||||
|
||||
mount(App, {
|
||||
target: document.getElementById('app')!,
|
||||
})
|
||||
2
integration/apps/svelte-vite/src/vite-env.d.ts
vendored
Normal file
2
integration/apps/svelte-vite/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/// <reference types="vite/client" />
|
||||
/// <reference types="svelte" />
|
||||
11
integration/apps/svelte-vite/svg-sprites.config.ts
Normal file
11
integration/apps/svelte-vite/svg-sprites.config.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export default {
|
||||
output: 'public/sprites',
|
||||
preview: false,
|
||||
sprites: [
|
||||
{
|
||||
name: 'icons',
|
||||
input: '../../fixtures/icons',
|
||||
format: 'symbol',
|
||||
},
|
||||
],
|
||||
}
|
||||
14
integration/apps/svelte-vite/tsconfig.json
Normal file
14
integration/apps/svelte-vite/tsconfig.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"allowArbitraryExtensions": true,
|
||||
"isolatedModules": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.svelte"]
|
||||
}
|
||||
6
integration/apps/svelte-vite/vite.config.ts
Normal file
6
integration/apps/svelte-vite/vite.config.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { svelte } from '@sveltejs/vite-plugin-svelte'
|
||||
import { defineConfig } from 'vite'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [svelte()],
|
||||
})
|
||||
Reference in New Issue
Block a user