mirror of
https://github.com/grafana/grafana.git
synced 2025-09-20 01:39:53 +08:00
![renovate[bot]](/assets/img/avatar_default.png)
* Update dependency msw to v1 * Fix breaking change --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
9 lines
341 B
TypeScript
9 lines
341 B
TypeScript
import { rest } from 'msw';
|
|
import { SetupServer } from 'msw/node';
|
|
|
|
import { DashboardSearchItem } from '../../../search/types';
|
|
|
|
export function mockSearchApiResponse(server: SetupServer, searchResult: DashboardSearchItem[]) {
|
|
server.use(rest.get('/api/search', (req, res, ctx) => res(ctx.json<DashboardSearchItem[]>(searchResult))));
|
|
}
|