mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Unlike the other map tests which heavily rely on mocks, this one uses React refs to inspect the constructed leaflet objects. The DOM itself doesn't appear to contain anything worth testing against (react-leaflet rendering doesn't work like typical React rendering). This required some infrastructure changes: 1. Forwarded ref from WaypointMarker to Marker so the test can observe it. Added a mergeRefs helper (and its own tests) to make that easier. 2. Switched from identity-obj-proxy to jest-transform-stub, because the former doesn't produce a useable image for imports, and we need usable images for leaflet to be able to render. This doesn't yet test drag and drop behavior since that requires mocking the backend, and this commit is already complicated enough. That'll be next.
87 lines
2.5 KiB
JSON
87 lines
2.5 KiB
JSON
{
|
|
"name": "liberation-client",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"main": "main.js",
|
|
"license": "LGPL-3.0-or-later",
|
|
"homepage": ".",
|
|
"dependencies": {
|
|
"@reduxjs/toolkit": "^1.8.5",
|
|
"@testing-library/jest-dom": "^5.16.5",
|
|
"@testing-library/react": "^13.4.0",
|
|
"@testing-library/user-event": "^14.4.3",
|
|
"@types/jest": "^29.1.2",
|
|
"@types/node": "^18.8.3",
|
|
"@types/react": "^18.0.21",
|
|
"@types/react-dom": "^18.0.6",
|
|
"@types/react-redux": "^7.1.24",
|
|
"axios": "^1.1.2",
|
|
"electron-window-state": "^5.0.3",
|
|
"esri-leaflet": "^3.0.8",
|
|
"leaflet": "^1.9.2",
|
|
"leaflet-ruler": "^1.0.0",
|
|
"milsymbol": "^2.0.0",
|
|
"react": "^18.2.0",
|
|
"react-dom": "^18.2.0",
|
|
"react-esri-leaflet": "^2.0.1",
|
|
"react-leaflet": "^4.1.0",
|
|
"react-redux": "^8.0.4",
|
|
"redux-logger": "^3.0.6",
|
|
"typescript": "~4.8.4"
|
|
},
|
|
"scripts": {
|
|
"start": "react-scripts start",
|
|
"build": "react-scripts build && generate-license-file --input package.json --output build/NOTICE",
|
|
"regenerate-api": "rtk-query-codegen-openapi ./openapi-config.ts",
|
|
"lint": "eslint src",
|
|
"prepare": "eslint src && license-checker --onlyAllow \"MIT;Apache-2.0;CC0-1.0;BSD-3-Clause;ISC;Custom: https://github.com/tmcw/jsonlint;BSD-2-Clause;Hippocratic-2.1;BSD*;WTFPL\" --excludePrivatePackages --production",
|
|
"test": "react-scripts test",
|
|
"eject": "react-scripts eject",
|
|
"electron": "wait-on tcp:3000 && electron ."
|
|
},
|
|
"eslintConfig": {
|
|
"extends": "react-app"
|
|
},
|
|
"eslintIgnore": [
|
|
"leaflet-ruler.d.ts"
|
|
],
|
|
"prettier": {
|
|
"endOfLine": "auto"
|
|
},
|
|
"browserslist": {
|
|
"production": [
|
|
">0.2%",
|
|
"not dead",
|
|
"not op_mini all"
|
|
],
|
|
"development": [
|
|
"last 1 chrome version",
|
|
"last 1 firefox version",
|
|
"last 1 safari version"
|
|
]
|
|
},
|
|
"devDependencies": {
|
|
"@rtk-query/codegen-openapi": "^1.0.0",
|
|
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
|
|
"@types/leaflet": "^1.8.0",
|
|
"@types/redux-logger": "^3.0.9",
|
|
"@types/websocket": "^1.0.5",
|
|
"electron": "^21.1.0",
|
|
"electron-is-dev": "^2.0.0",
|
|
"generate-license-file": "^2.0.0",
|
|
"jest-transform-stub": "^2.0.0",
|
|
"license-checker": "^25.0.1",
|
|
"react-scripts": "5.0.1",
|
|
"ts-node": "^10.9.1",
|
|
"wait-on": "^6.0.1"
|
|
},
|
|
"jest": {
|
|
"transformIgnorePatterns": [
|
|
"node_modules/(?!(@?react-leaflet|axios)/)"
|
|
],
|
|
"moduleNameMapper": {
|
|
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub"
|
|
}
|
|
}
|
|
}
|