Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pipenv run python manage.py migrate # aplikuje migrace na DB

```bash
# Testy a kvalita kódu (z rootu repozitáře — doporučeno pro CI paritu)
npm run frontend:test # typy + lint + jest (kompletní frontend CI suite)
npm run frontend:test # typy + lint + vitest (kompletní frontend CI suite)
npm run frontend:lint:js # pouze ESLint
npm run frontend:audit # security audit závislostí (audit-ci)

Expand All @@ -67,8 +67,8 @@ npm run types # TypeScript typová kontrola (tsc)
npm run types:watch # tsc ve watch módu
npm run lint # ESLint + Prettier check
npm run lint! # ESLint + Prettier autofix
npm run jest # pouze Jest testy
npm run jest:watch # Jest ve watch módu
npm run vitest # pouze Vitest testy
npm run vitest:watch # Vitest ve watch módu
npm run build # produkční build (Webpack)
npm run build:analyze # bundle analyzer
```
Expand Down Expand Up @@ -124,9 +124,9 @@ React 19 SPA v [frontend/src/](frontend/src/). Webpack dev server na portu 3000

**Frontend konvence:**
- Formátování: Prettier (`tabWidth: 4`, `printWidth: 100`)
- Linting: ESLint 9 s pluginy (react, typescript, jest, testing-library, vanilla-extract, tanstack-query)
- Linting: ESLint 9 s pluginy (react, typescript, jest-dom, testing-library, vanilla-extract, tanstack-query)
- CSS: soubory pojmenovány `*.css.ts`, **vždy** vanilla-extract — nikdy inline styly ani plain CSS
- Testy: Jest + React Testing Library, soubory colocated se zdrojovým kódem (`*.test.ts` / `*.test.tsx`), API mockované přes MSW
- Testy: Vitest + React Testing Library, soubory colocated se zdrojovým kódem (`*.test.ts` / `*.test.tsx`), API mockované přes MSW

**Pre-commit hooky (Husky + lint-staged):** automaticky spouštějí ESLint a Prettier na staged JS/TS souborech.

Expand All @@ -146,7 +146,7 @@ React 19 SPA v [frontend/src/](frontend/src/). Webpack dev server na portu 3000
**CI** ([`.github/workflows/test.yml`](.github/workflows/test.yml)) se spouští na každý push/PR do `master`:
1. Nainstaluje Node 20 + Python 3.12 + závislosti
2. Vytvoří `.npmrc` pro FontAwesome PRO z private GitHub Package Registry (token `GPR_TOKEN`)
3. Spustí frontend testy (typy + lint + jest)
3. Spustí frontend testy (typy + lint + vitest)
4. Spustí mypy
5. Nastartuje PostgreSQL 14 s českou locale v Dockeru
6. Buildne Django (migrace + staticfiles) přes `scripts/shell/release_tasks.sh`
Expand Down
6 changes: 3 additions & 3 deletions README.cs.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ barevným štítkem v horním menu (kromě produkce).
- E2E testování je postaveno na **BDD frameworku [behave](https://github.com/behave/behave)** –
testové scénáře jsou psány přirozeným jazykem (Gherkin), podle nich se spouští konkrétní
testy.
- Unit testy jsou postaveny na **frameworku [Jest](https://jestjs.io/)** a nástrojích
- Unit testy jsou postaveny na **frameworku [Vitest](https://vitest.dev/)** a nástrojích
**[React Testing Library](https://testing-library.com/docs/react-testing-library/intro)**
(jednoduché utility pro testování Reactu),
[jest-dom](https://testing-library.com/docs/ecosystem-jest-dom) (custom DOM element matchers
pro Jest) a [MSW](https://mswjs.io/) (mockování API).
[jest-dom](https://testing-library.com/docs/ecosystem-jest-dom) (custom DOM element matchers)
a [MSW](https://mswjs.io/) (mockování API).
- Pro **testování UI (E2E)** se používá [Selenium](https://github.com/SeleniumHQ/selenium).
- **Podrobné informace o testech jsou v [`tests/README.md`](tests)**.

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ title and color (except for the production).
- E2E testing is built on a **BDD framework [behave](https://github.com/behave/behave)** –
testing scenarios are written using a natural language (Gherkin), each of the tests is run
according to them.
- Unit tests are built on a **[Jest](https://jestjs.io/) framework** and tools like
- Unit tests are built on a **[Vitest](https://vitest.dev/) framework** and tools like
**[React Testing Library](https://testing-library.com/docs/react-testing-library/intro)**
(simple React testing utilities),
[jest-dom](https://testing-library.com/docs/ecosystem-jest-dom) (custom DOM element matchers
for Jest) and [MSW](https://mswjs.io/) (API mocking).
[jest-dom](https://testing-library.com/docs/ecosystem-jest-dom) (custom DOM element matchers)
and [MSW](https://mswjs.io/) (API mocking).
- **UI (E2E) testing** is taken care of by [Selenium](https://github.com/SeleniumHQ/selenium).
- **Details about the tests are available in [`tests/README.md` (CZ)](tests)**.

Expand Down
12 changes: 0 additions & 12 deletions frontend/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ module.exports = {
plugins: ["react-refresh/babel"],
},
production: {
// vycleneni useESModules pouze na produkci kvuli nefunkcnimu Jestu
plugins: [
[
"@babel/plugin-transform-runtime",
{
useESModules: true,
},
],
],
},
test: {
// Jest deps
plugins: [["@babel/plugin-transform-runtime"]],
},
},
Expand Down
9 changes: 5 additions & 4 deletions frontend/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default [
"__mocks__/**",
"babel.config.js",
"eslint.config.mjs",
"jest.config.js",
"jest.setup.ts",
"vitest.config.ts",
"vitest.setup.ts",
"webpack.config.js",
],
},
Expand All @@ -51,15 +51,15 @@ export default [
jsx: true,
},
projectService: {
allowDefaultProject: ["*.config.js", "*.config.ts", "jest.setup.ts"],
allowDefaultProject: ["*.config.js", "*.config.ts", "vitest.setup.ts"],
},
tsconfigRootDir: import.meta.dirname,
},
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
...globals.jest,
...globals.vitest,
Atomics: "readonly",
SharedArrayBuffer: "readonly",
},
Expand Down Expand Up @@ -98,6 +98,7 @@ export default [
...testingLibrary.configs.react.rules,

"react/prop-types": 0,
"react/react-in-jsx-scope": "off",

curly: "error",
"no-console": ["error", { allow: ["warn", "error"] }],
Expand Down
13 changes: 0 additions & 13 deletions frontend/jest.config.js

This file was deleted.

Loading
Loading