mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
22 lines
576 B
TypeScript
22 lines
576 B
TypeScript
|
|
import { rest } from 'msw';
|
||
|
|
import { setupServer } from 'msw/node';
|
||
|
|
|
||
|
|
// bit of setup to mock HTTP request responses
|
||
|
|
import 'whatwg-fetch';
|
||
|
|
import { SupportedPlugin } from './PluginBridge';
|
||
|
|
|
||
|
|
export const NON_EXISTING_PLUGIN = '__does_not_exist__';
|
||
|
|
|
||
|
|
const server = setupServer(
|
||
|
|
rest.get(`/api/plugins/${NON_EXISTING_PLUGIN}/settings`, async (_req, res, ctx) => res(ctx.status(404))),
|
||
|
|
rest.get(`/api/plugins/${SupportedPlugin.Incident}/settings`, async (_req, res, ctx) => {
|
||
|
|
return res(
|
||
|
|
ctx.json({
|
||
|
|
enabled: true,
|
||
|
|
})
|
||
|
|
);
|
||
|
|
})
|
||
|
|
);
|
||
|
|
|
||
|
|
export { server };
|