mirror of
https://github.com/n8n-io/n8n.git
synced 2026-07-28 19:45:09 +02:00
Some checks failed
CI: Master (Build, Test, Lint) / Build for Github Cache (push) Has been cancelled
CI: Master (Build, Test, Lint) / Unit tests (22.22.3) (push) Has been cancelled
CI: Master (Build, Test, Lint) / Unit tests (24.16.0) (push) Has been cancelled
CI: Master (Build, Test, Lint) / Lint (push) Has been cancelled
CI: Master (Build, Test, Lint) / Performance (push) Has been cancelled
CI: Master (Build, Test, Lint) / Notify Slack on failure (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Util: Update Node Popularity / approve-and-automerge (push) Has been cancelled
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
29 lines
898 B
TypeScript
29 lines
898 B
TypeScript
import { ExpressionError } from '../../src/errors';
|
|
|
|
describe('ExecutionBaseError', () => {
|
|
it('should set name to the concrete class name', () => {
|
|
const error = new ExpressionError('message');
|
|
|
|
expect(error.name).toBe('ExpressionError');
|
|
});
|
|
|
|
describe('with a frozen Error.prototype', () => {
|
|
const nameDescriptor = Object.getOwnPropertyDescriptor(Error.prototype, 'name')!;
|
|
|
|
beforeAll(() => {
|
|
Object.defineProperty(Error.prototype, 'name', { ...nameDescriptor, writable: false });
|
|
});
|
|
|
|
afterAll(() => {
|
|
Object.defineProperty(Error.prototype, 'name', nameDescriptor);
|
|
});
|
|
|
|
it('should construct and set name without writing through the prototype', () => {
|
|
const error = new ExpressionError('Paired item data is unavailable');
|
|
|
|
expect(error.name).toBe('ExpressionError');
|
|
expect(Object.getOwnPropertyDescriptor(error, 'name')?.writable).toBe(true);
|
|
});
|
|
});
|
|
});
|