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/vanilla-vite/index.html
Normal file
12
integration/apps/vanilla-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>Vanilla Vite sprite fixture</title>
|
||||
</head>
|
||||
<body>
|
||||
<main id="app"></main>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
17
integration/apps/vanilla-vite/package.json
Normal file
17
integration/apps/vanilla-vite/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "@svg-sprites-fixtures/vanilla-vite",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"sprites": "svg-sprites --mode legacy .",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"build": "npm run sprites && tsc --noEmit && vite build",
|
||||
"dev": "npm run sprites && vite"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gromlab/svg-sprites": "file:../../..",
|
||||
"typescript": "6.0.2",
|
||||
"vite": "8.1.4"
|
||||
}
|
||||
}
|
||||
8
integration/apps/vanilla-vite/src/main.ts
Normal file
8
integration/apps/vanilla-vite/src/main.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import './style.css'
|
||||
|
||||
document.querySelector<HTMLDivElement>('#app')!.innerHTML = `
|
||||
<h1>Vanilla + Vite</h1>
|
||||
<svg data-testid="icon" data-app="vanilla-vite" aria-label="Check icon" viewBox="0 0 24 24">
|
||||
<use href="/sprites/icons.sprite.svg#check"></use>
|
||||
</svg>
|
||||
`
|
||||
16
integration/apps/vanilla-vite/src/style.css
Normal file
16
integration/apps/vanilla-vite/src/style.css
Normal file
@@ -0,0 +1,16 @@
|
||||
:root {
|
||||
font-family: system-ui, sans-serif;
|
||||
color: #172033;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 40px;
|
||||
}
|
||||
|
||||
[data-testid='icon'] {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
color: #16a34a;
|
||||
}
|
||||
1
integration/apps/vanilla-vite/src/vite-env.d.ts
vendored
Normal file
1
integration/apps/vanilla-vite/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/// <reference types="vite/client" />
|
||||
11
integration/apps/vanilla-vite/svg-sprites.config.ts
Normal file
11
integration/apps/vanilla-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',
|
||||
},
|
||||
],
|
||||
}
|
||||
11
integration/apps/vanilla-vite/tsconfig.json
Normal file
11
integration/apps/vanilla-vite/tsconfig.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"lib": ["ES2022", "DOM"],
|
||||
"strict": true,
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
Reference in New Issue
Block a user