mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* AzureMonitor: display errors from requests for the dropdowns * switch to array of errors, using just the last one * unify error object * move files into utils * TESTS * fix tests
15 lines
522 B
TypeScript
15 lines
522 B
TypeScript
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.");
|
|
});
|
|
});
|