mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(Read PDF Node): Replace pdf-parse with pdfjs, and add support for streaming and encrypted PDFs (#6640)
This commit is contained in:
committed by
GitHub
parent
acda7f269f
commit
0a31b8e2b4
@@ -321,6 +321,15 @@ export const equalityTest = async (testData: WorkflowTestData, types: INodeTypes
|
||||
const resultNodeData = getResultNodeData(result, testData);
|
||||
resultNodeData.forEach(({ nodeName, resultData }) => {
|
||||
const msg = `Equality failed for "${testData.description}" at node "${nodeName}"`;
|
||||
resultData.forEach((item) => {
|
||||
item?.forEach(({ binary }) => {
|
||||
if (binary) {
|
||||
// @ts-ignore
|
||||
delete binary.data.data;
|
||||
delete binary.data.directory;
|
||||
}
|
||||
});
|
||||
});
|
||||
return expect(resultData, msg).toEqual(testData.output.nodeData[nodeName]);
|
||||
});
|
||||
|
||||
@@ -345,6 +354,14 @@ export const workflowToTests = (workflowFiles: string[]) => {
|
||||
for (const filePath of workflowFiles) {
|
||||
const description = filePath.replace('.json', '');
|
||||
const workflowData = readJsonFileSync<IWorkflowBase>(filePath);
|
||||
const testDir = path.join(baseDir, path.dirname(filePath));
|
||||
workflowData.nodes.forEach((node) => {
|
||||
if (node.parameters) {
|
||||
node.parameters = JSON.parse(
|
||||
JSON.stringify(node.parameters).replace(/"C:\\\\Test\\\\(.*)"/, `"${testDir}/$1"`),
|
||||
);
|
||||
}
|
||||
});
|
||||
if (workflowData.pinData === undefined) {
|
||||
throw new Error('Workflow data does not contain pinData');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user