Alerting: mocking and testing of Alerting package (#105342)

This commit is contained in:
Gilles De Mey
2025-05-21 12:47:31 +02:00
committed by GitHub
parent e2cd5c870f
commit 777d2e8e4a
29 changed files with 657 additions and 105 deletions

View File

@ -9,6 +9,7 @@ import type { ConfigFile } from '@rtk-query/codegen-openapi';
// append versions here to generate additional API clients
const VERSIONS = ['v0alpha1'] as const;
const GROUP = 'notifications.alerting.grafana.app' as const;
type OutputFile = Omit<ConfigFile, 'outputFile'>;
type OutputFiles = Record<string, OutputFile>;
@ -19,7 +20,7 @@ const outputFiles = VERSIONS.reduce<OutputFiles>((acc, version) => {
// these snapshots are generated by running "go test pkg/tests/apis/openapi_test.go" and "scripts/process-specs.ts",
// see the README in the "openapi_snapshots" directory
const schemaFile = `../../../data/openapi/notifications.alerting.grafana.app-${version}.json`;
const schemaFile = `../../../data/openapi/${GROUP}-${version}.json`;
// make sure there is a API file in each versioned directory
const apiFile = `../src/grafana/api/${version}/api.ts`;