The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/plugins/datasource/azuremonitor/utils/messageFromError.test.ts

15 lines
523 B

import { invalidNamespaceError } from '../__mocks__/errors';
import messageFromError from './messageFromError';
describe('AzureMonitor: messageFromError', () => {
it('returns message from Error exception', () => {
const err = new Error('wowee an error');
expect(messageFromError(err)).toBe('wowee an error');
});
it('returns message from Azure API error', () => {
const err = invalidNamespaceError();
expect(messageFromError(err)).toBe("The resource namespace 'grafanadev' is invalid.");
});
});