- tests/apiClient.test.ts (tsx/node:test, fetch stubbé) : paths/méthodes/query/body de tous les endpoints, multipart FormData sans Content-Type manuel, enveloppe {data,meta}, Bearer (présent/absent/fusion)
- cas hostiles : 2xx HTML/corps vide/JSON invalide/objet sans data/error → ApiError INVALID_RESPONSE (jamais de TypeError ni data indéfini) ; bare 5xx → HTTP_<status> ; fetch rejeté (dont AbortError) → NETWORK_ERROR ; [] toléré en data
- client.ts : parse d'enveloppe stricte dans request() (nouveau code client INVALID_RESPONSE)
- package.json : scripts test:api + test (db + api)
43 lines
1.2 KiB
JSON
43 lines
1.2 KiB
JSON
{
|
|
"name": "webui",
|
|
"version": "2.0.0",
|
|
"main": "expo-router/entry",
|
|
"dependencies": {
|
|
"@expo/vector-icons": "^15.1.1",
|
|
"@tanstack/react-query": "^5.102.8",
|
|
"expo": "~57.0.8",
|
|
"expo-constants": "~57.0.17",
|
|
"expo-file-system": "~57.0.6",
|
|
"expo-linking": "~57.0.9",
|
|
"expo-localization": "~57.0.1",
|
|
"expo-router": "~57.0.20",
|
|
"expo-sqlite": "~57.0.2",
|
|
"expo-status-bar": "~57.0.1",
|
|
"i18n-js": "^4.5.3",
|
|
"react": "19.2.3",
|
|
"react-dom": "19.2.3",
|
|
"react-native": "0.86.0",
|
|
"react-native-safe-area-context": "~5.7.0",
|
|
"react-native-screens": "~4.26.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/better-sqlite3": "^9.6.0",
|
|
"@types/react": "~19.2.2",
|
|
"babel-preset-expo": "^57.0.4",
|
|
"better-sqlite3": "^13.0.3",
|
|
"tsx": "^4.23.13",
|
|
"typescript": "~6.0.3"
|
|
},
|
|
"scripts": {
|
|
"start": "expo start",
|
|
"android": "expo run:android",
|
|
"ios": "expo run:ios",
|
|
"web": "expo start --web",
|
|
"test:db": "tsx --test tests/migrations.test.ts tests/repositories.test.ts",
|
|
"test:migrations": "tsx --test tests/migrations.test.ts",
|
|
"test:api": "tsx --test tests/apiClient.test.ts",
|
|
"test": "npm run test:db && npm run test:api"
|
|
},
|
|
"private": true
|
|
}
|