mirror of
https://github.com/n8n-io/n8n.git
synced 2026-12-04 08:42:01 +00:00
Co-authored-by: n8n-cat-bot[bot] <n8n-cat-bot[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
20 lines
601 B
TypeScript
20 lines
601 B
TypeScript
import { getErrorMessage } from './get-error-message';
|
|
|
|
describe('getErrorMessage', () => {
|
|
it('returns the message of an Error instance', () => {
|
|
expect(getErrorMessage(new Error('original error'))).toBe('original error');
|
|
});
|
|
|
|
it('returns a string unchanged', () => {
|
|
expect(getErrorMessage('something went wrong')).toBe('something went wrong');
|
|
});
|
|
|
|
it('returns the string form of an object', () => {
|
|
expect(getErrorMessage({ code: 42 })).toBe('[object Object]');
|
|
});
|
|
|
|
it('returns the string form of undefined', () => {
|
|
expect(getErrorMessage(undefined)).toBe('undefined');
|
|
});
|
|
});
|