mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Update dependency msw to v2 * close * minor fixes * fetch import changes * fix some alerting tests * fix another alerting test * fix systemjs tests * don't return undefined in json mocks * don't return undefined in json response * add type --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
27 lines
616 B
TypeScript
27 lines
616 B
TypeScript
// bit of setup to mock HTTP request responses
|
|
import 'whatwg-fetch';
|
|
import { http, HttpResponse } from 'msw';
|
|
import { setupServer } from 'msw/node';
|
|
|
|
import { SupportedPlugin } from '../types/pluginBridges';
|
|
|
|
export const NON_EXISTING_PLUGIN = '__does_not_exist__';
|
|
|
|
const server = setupServer(
|
|
http.get(`/api/plugins/${NON_EXISTING_PLUGIN}/settings`, async () =>
|
|
HttpResponse.json(
|
|
{},
|
|
{
|
|
status: 404,
|
|
}
|
|
)
|
|
),
|
|
http.get(`/api/plugins/${SupportedPlugin.Incident}/settings`, async () => {
|
|
return HttpResponse.json({
|
|
enabled: true,
|
|
});
|
|
})
|
|
);
|
|
|
|
export { server };
|