fix(core): Fix supportedNodes for non-lazy loaded community packages (no-changelog) (#11329)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-12-10 14:48:39 +01:00
committed by GitHub
parent 1c52bf9362
commit 2d36b42798
28 changed files with 1435 additions and 586 deletions

View File

@@ -4,7 +4,12 @@ import { tmpdir } from 'os';
import nock from 'nock';
import { isEmpty } from 'lodash';
import { get } from 'lodash';
import { BinaryDataService, Credentials, constructExecutionMetaData } from 'n8n-core';
import {
BinaryDataService,
Credentials,
UnrecognizedNodeTypeError,
constructExecutionMetaData,
} from 'n8n-core';
import { Container } from 'typedi';
import { mock } from 'jest-mock-extended';
import type {
@@ -251,12 +256,9 @@ export function setup(testData: WorkflowTestData[] | WorkflowTestData) {
const nodeNames = nodes.map((n) => n.type);
for (const nodeName of nodeNames) {
if (!nodeName.startsWith('n8n-nodes-base.')) {
throw new ApplicationError(`Unknown node type: ${nodeName}`, { level: 'warning' });
}
const loadInfo = knownNodes[nodeName.replace('n8n-nodes-base.', '')];
if (!loadInfo) {
throw new ApplicationError(`Unknown node type: ${nodeName}`, { level: 'warning' });
throw new UnrecognizedNodeTypeError('n8n-nodes-base', nodeName);
}
const sourcePath = loadInfo.sourcePath.replace(/^dist\//, './').replace(/\.js$/, '.ts');
const nodeSourcePath = path.join(baseDir, sourcePath);