first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled

This commit is contained in:
2026-03-17 16:22:57 +03:30
commit 3d5eaf9445
15349 changed files with 2847338 additions and 0 deletions
@@ -0,0 +1,26 @@
import { BaseError } from '../../../src/errors/base/base.error';
import { OperationalError } from '../../../src/errors/base/operational.error';
describe('OperationalError', () => {
it('should be an instance of OperationalError', () => {
const error = new OperationalError('test');
expect(error).toBeInstanceOf(OperationalError);
});
it('should be an instance of BaseError', () => {
const error = new OperationalError('test');
expect(error).toBeInstanceOf(BaseError);
});
it('should have correct defaults', () => {
const error = new OperationalError('test');
expect(error.level).toBe('warning');
expect(error.shouldReport).toBe(false);
});
it('should allow overriding the default level and shouldReport', () => {
const error = new OperationalError('test', { level: 'error', shouldReport: true });
expect(error.level).toBe('error');
expect(error.shouldReport).toBe(true);
});
});
@@ -0,0 +1,26 @@
import { BaseError } from '../../../src/errors/base/base.error';
import { UnexpectedError } from '../../../src/errors/base/unexpected.error';
describe('UnexpectedError', () => {
it('should be an instance of UnexpectedError', () => {
const error = new UnexpectedError('test');
expect(error).toBeInstanceOf(UnexpectedError);
});
it('should be an instance of BaseError', () => {
const error = new UnexpectedError('test');
expect(error).toBeInstanceOf(BaseError);
});
it('should have correct defaults', () => {
const error = new UnexpectedError('test');
expect(error.level).toBe('error');
expect(error.shouldReport).toBe(true);
});
it('should allow overriding the default level and shouldReport', () => {
const error = new UnexpectedError('test', { level: 'fatal', shouldReport: false });
expect(error.level).toBe('fatal');
expect(error.shouldReport).toBe(false);
});
});
@@ -0,0 +1,26 @@
import { BaseError } from '../../../src/errors/base/base.error';
import { UserError } from '../../../src/errors/base/user.error';
describe('UserError', () => {
it('should be an instance of UserError', () => {
const error = new UserError('test');
expect(error).toBeInstanceOf(UserError);
});
it('should be an instance of BaseError', () => {
const error = new UserError('test');
expect(error).toBeInstanceOf(BaseError);
});
it('should have correct defaults', () => {
const error = new UserError('test');
expect(error.level).toBe('info');
expect(error.shouldReport).toBe(false);
});
it('should allow overriding the default level and shouldReport', () => {
const error = new UserError('test', { level: 'warning', shouldReport: true });
expect(error.level).toBe('warning');
expect(error.shouldReport).toBe(true);
});
});
@@ -0,0 +1,24 @@
import { mock } from 'vitest-mock-extended';
import { NodeApiError } from '../../src/errors/node-api.error';
import { NodeOperationError } from '../../src/errors/node-operation.error';
import type { INode } from '../../src/interfaces';
describe('NodeError', () => {
const node = mock<INode>();
it('should update re-wrapped error level and message', () => {
vi.useFakeTimers({ now: new Date() });
const apiError = new NodeApiError(node, { message: 'Some error happened', code: 500 });
const opsError = new NodeOperationError(node, mock(), { message: 'Some operation failed' });
const wrapped1 = new NodeOperationError(node, apiError);
const wrapped2 = new NodeOperationError(node, opsError);
expect(wrapped1.level).toEqual(apiError.level);
expect(wrapped1.message).toEqual(apiError.message);
expect(wrapped2).toEqual(opsError);
vi.useRealTimers();
});
});
@@ -0,0 +1,32 @@
import { WorkflowActivationError } from '../../src/errors';
describe('WorkflowActivationError', () => {
it('should default to `error` level', () => {
const error = new WorkflowActivationError('message');
expect(error.level).toBe('error');
});
const cause = new Error('Some error message');
it('should set `level` based on arg', () => {
const firstError = new WorkflowActivationError('message', { level: 'warning', cause });
expect(firstError.level).toBe('warning');
const secondError = new WorkflowActivationError('message', { level: 'error', cause });
expect(secondError.level).toBe('error');
});
test.each([
'ETIMEDOUT',
'ECONNREFUSED',
'EAUTH',
'Temporary authentication failure',
'Invalid credentials',
])('should set `level` to `warning` for `%s`', (code) => {
const error = new WorkflowActivationError(code, { cause });
expect(error.level).toBe('warning');
});
});