mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
There isn't any UI observable behavior of the dragend of the waypoint, but we can test that the backend was called. The only uncovered parts of that component are now error paths, but the error handling in that component is to just ignore errors, so there's also nothing to test there.
19 lines
456 B
TypeScript
19 lines
456 B
TypeScript
import axios from "axios";
|
|
|
|
const backendAddr =
|
|
new URL(window.location.toString()).searchParams.get("server") ??
|
|
"[::1]:16880";
|
|
|
|
// MSW can't handle IPv6 URLs...
|
|
// https://github.com/mswjs/msw/issues/1388
|
|
export const HTTP_URL =
|
|
process.env.NODE_ENV === "test" ? "" : `http://${backendAddr}/`;
|
|
|
|
export const backend = axios.create({
|
|
baseURL: HTTP_URL,
|
|
});
|
|
|
|
export const WEBSOCKET_URL = `ws://${backendAddr}/eventstream`;
|
|
|
|
export default backend;
|