feat: improve test stability and API routing

- Add proxy configuration for API requests in dev/test
- Target default endorser API server in development
- Add proxy for /api endpoints to handle CORS
- Enhance contact management test reliability
- Add comprehensive error handling and debugging
- Extract test helper functions

Breaking: None
This commit is contained in:
Matthew Raymer
2025-02-14 10:27:01 +00:00
parent 11d1fae35a
commit a5c86fbc53
2 changed files with 179 additions and 1 deletions

View File

@@ -32,7 +32,13 @@ export default defineConfig(({ mode }) => {
port: process.env.VITE_PORT || 8080,
fs: {
strict: false
}
},
proxy: process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test' ? {
'/api': {
target: process.env.VITE_DEFAULT_ENDORSER_API_SERVER || 'http://localhost:3000',
changeOrigin: true,
},
} : undefined,
},
build: {
outDir: isElectron ? "dist-electron" : "dist",