mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-09-24 18:26:51 +03:00
Remove unused deps (#24355)
* remove unused web test deps Nothing runs vitest. The CI step that called `npm run test` is commented out, `web/__test__/` was deleted in https://github.com/blakeblackshear/frigate/pull/8983 so `setupFiles` points at a missing file, and there are no unit tests, so `npx vitest run` only picks up the Playwright specs and fails. jsdom, `@testing-library/jest-dom`, msw and fake-indexeddb were only there for vitest. * update contributing docs * remove unused deps
This commit is contained in:
@@ -46,9 +46,6 @@ jobs:
|
|||||||
- name: Build web
|
- name: Build web
|
||||||
run: npm run build
|
run: npm run build
|
||||||
working-directory: ./web
|
working-directory: ./web
|
||||||
# - name: Test
|
|
||||||
# run: npm run test
|
|
||||||
# working-directory: ./web
|
|
||||||
|
|
||||||
web_e2e:
|
web_e2e:
|
||||||
name: Web - E2E Tests
|
name: Web - E2E Tests
|
||||||
|
|||||||
@@ -204,11 +204,20 @@ Light guidelines and advice:
|
|||||||
npm run lint
|
npm run lint
|
||||||
```
|
```
|
||||||
|
|
||||||
- Add to unit tests and ensure they pass. As much as possible, you should strive to _increase_ test coverage whenever making changes. This will help ensure features do not accidentally become broken in the future.
|
- Ensure the backend [unit tests](#unit-tests) pass. Your PR cannot be merged unless tests pass.
|
||||||
- If you run into error messages like "TypeError: Cannot read properties of undefined (reading 'context')" when running tests, this may be due to these issues (https://github.com/vitest-dev/vitest/issues/1910, https://github.com/vitest-dev/vitest/issues/1652) in vitest, but I haven't been able to resolve them.
|
|
||||||
|
```shell
|
||||||
|
python3 -u -m unittest
|
||||||
|
```
|
||||||
|
|
||||||
|
- Ensure the end-to-end tests pass. They run in Playwright against a production build with mocked API data, so they don't need a running Frigate instance. Add or update tests in `web/e2e/specs/` when you change UI behavior.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
npm run test
|
# First-time setup
|
||||||
|
npx playwright install chromium
|
||||||
|
|
||||||
|
# Build the app and run all tests
|
||||||
|
npm run e2e:build && npm run e2e
|
||||||
```
|
```
|
||||||
|
|
||||||
- Test in different browsers. Firefox, Chrome, and Safari all have different quirks that make them unique targets to interact with.
|
- Test in different browsers. Firefox, Chrome, and Safari all have different quirks that make them unique targets to interact with.
|
||||||
|
|||||||
Generated
+1
-1457
File diff suppressed because it is too large
Load Diff
+1
-14
@@ -12,8 +12,6 @@
|
|||||||
"lint:fix": "eslint --fix .",
|
"lint:fix": "eslint --fix .",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"prettier:write": "prettier -u -w --ignore-path .gitignore \"*.{ts,tsx,js,jsx,css,html}\"",
|
"prettier:write": "prettier -u -w --ignore-path .gitignore \"*.{ts,tsx,js,jsx,css,html}\"",
|
||||||
"test": "vitest",
|
|
||||||
"coverage": "vitest run --coverage",
|
|
||||||
"e2e:build": "tsc && vite build --base=/",
|
"e2e:build": "tsc && vite build --base=/",
|
||||||
"e2e": "playwright test --config e2e/playwright.config.ts",
|
"e2e": "playwright test --config e2e/playwright.config.ts",
|
||||||
"e2e:ui": "playwright test --config e2e/playwright.config.ts --ui",
|
"e2e:ui": "playwright test --config e2e/playwright.config.ts --ui",
|
||||||
@@ -89,8 +87,6 @@
|
|||||||
"remark-gfm": "^4.0.0",
|
"remark-gfm": "^4.0.0",
|
||||||
"scroll-into-view-if-needed": "^3.1.0",
|
"scroll-into-view-if-needed": "^3.1.0",
|
||||||
"sonner": "^2.0.8",
|
"sonner": "^2.0.8",
|
||||||
"sort-by": "^1.2.0",
|
|
||||||
"strftime": "^0.10.3",
|
|
||||||
"swr": "^2.5.1",
|
"swr": "^2.5.1",
|
||||||
"tailwind-merge": "^2.4.0",
|
"tailwind-merge": "^2.4.0",
|
||||||
"tailwind-scrollbar": "^3.1.0",
|
"tailwind-scrollbar": "^3.1.0",
|
||||||
@@ -104,16 +100,12 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@playwright/test": "^1.63.0",
|
"@playwright/test": "^1.63.0",
|
||||||
"@tailwindcss/forms": "^0.5.11",
|
|
||||||
"@testing-library/jest-dom": "^6.6.2",
|
|
||||||
"@types/js-yaml": "^4.0.9",
|
"@types/js-yaml": "^4.0.9",
|
||||||
"@types/lodash": "^4.17.25",
|
"@types/lodash": "^4.17.25",
|
||||||
"@types/node": "^25.9.6",
|
"@types/node": "^25.9.6",
|
||||||
"@types/react": "^19.3.0",
|
"@types/react": "^19.3.0",
|
||||||
"@types/react-dom": "^19.3.0",
|
"@types/react-dom": "^19.3.0",
|
||||||
"@types/strftime": "^0.9.8",
|
|
||||||
"@vitejs/plugin-react": "^6.1.1",
|
"@vitejs/plugin-react": "^6.1.1",
|
||||||
"@vitest/coverage-v8": "^4.1.11",
|
|
||||||
"autoprefixer": "^10.6.0",
|
"autoprefixer": "^10.6.0",
|
||||||
"esbuild": "^0.28.2",
|
"esbuild": "^0.28.2",
|
||||||
"eslint": "^10.10.0",
|
"eslint": "^10.10.0",
|
||||||
@@ -121,13 +113,9 @@
|
|||||||
"eslint-plugin-prettier": "^5.5.6",
|
"eslint-plugin-prettier": "^5.5.6",
|
||||||
"eslint-plugin-react-hooks": "^7.1.1",
|
"eslint-plugin-react-hooks": "^7.1.1",
|
||||||
"eslint-plugin-react-refresh": "^0.5.7",
|
"eslint-plugin-react-refresh": "^0.5.7",
|
||||||
"fake-indexeddb": "^6.0.0",
|
|
||||||
"globals": "^17.12.0",
|
"globals": "^17.12.0",
|
||||||
"i18next-cli": "^1.5.11",
|
"i18next-cli": "^1.5.11",
|
||||||
"jest-websocket-mock": "^2.5.0",
|
|
||||||
"jsdom": "^24.1.1",
|
|
||||||
"monaco-editor": "^0.52.2",
|
"monaco-editor": "^0.52.2",
|
||||||
"msw": "^2.3.5",
|
|
||||||
"patch-package": "^8.0.1",
|
"patch-package": "^8.0.1",
|
||||||
"postcss": "^8.5.12",
|
"postcss": "^8.5.12",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
@@ -135,8 +123,7 @@
|
|||||||
"tailwindcss": "^3.4.9",
|
"tailwindcss": "^3.4.9",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"typescript-eslint": "^8.70.0",
|
"typescript-eslint": "^8.70.0",
|
||||||
"vite": "^8.3.0",
|
"vite": "^8.3.0"
|
||||||
"vitest": "^4.1.11"
|
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"@radix-ui/react-compose-refs": "1.1.2",
|
"@radix-ui/react-compose-refs": "1.1.2",
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
/// <reference types="vitest/config" />
|
|
||||||
import path, { resolve } from "path";
|
import path, { resolve } from "path";
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import react from "@vitejs/plugin-react";
|
import react from "@vitejs/plugin-react";
|
||||||
@@ -8,9 +7,6 @@ const proxyHost = process.env.PROXY_HOST || "localhost:5000";
|
|||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
define: {
|
|
||||||
"import.meta.vitest": "undefined",
|
|
||||||
},
|
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
"/api": {
|
"/api": {
|
||||||
@@ -60,21 +56,4 @@ export default defineConfig({
|
|||||||
"@": path.resolve(import.meta.dirname, "./src"),
|
"@": path.resolve(import.meta.dirname, "./src"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
test: {
|
|
||||||
environment: "jsdom",
|
|
||||||
alias: {
|
|
||||||
"testing-library": path.resolve(
|
|
||||||
import.meta.dirname,
|
|
||||||
"./__test__/testing-library.js",
|
|
||||||
),
|
|
||||||
},
|
|
||||||
setupFiles: ["./__test__/test-setup.ts"],
|
|
||||||
includeSource: ["src/**/*.{js,jsx,ts,tsx}"],
|
|
||||||
coverage: {
|
|
||||||
reporter: ["text-summary", "text"],
|
|
||||||
},
|
|
||||||
mockReset: true,
|
|
||||||
restoreMocks: true,
|
|
||||||
globals: true,
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user