pull:初次提交

This commit is contained in:
Yep_Q
2025-09-08 04:48:28 +08:00
parent 5c0619656d
commit f64f498365
11751 changed files with 1953723 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import type { WorkflowTestData } from 'n8n-workflow';
import path from 'path';
describe('Test Read Binary Files Node', () => {
const testHarness = new NodeTestHarness();
const workflowData = testHarness.readWorkflowJSON('ReadBinaryFiles.workflow.json');
const node = workflowData.nodes.find((n) => n.name === 'Read Binary Files')!;
const dir = path.join(__dirname, 'data').split('\\').join('/');
node.parameters.fileSelector = `${dir}/*.json`;
const tests: WorkflowTestData[] = [
{
description: 'nodes/ReadBinaryFiles/test/ReadBinaryFiles.workflow.json',
input: {
workflowData,
},
output: {
assertBinaryData: true,
nodeData: {
'Read Binary Files': [
[
{
binary: {
data: {
mimeType: 'application/json',
fileType: 'json',
fileExtension: 'json',
data: 'ewoJInRpdGxlIjogIkxvcmVtIElwc3VtIgp9Cg==',
fileName: 'sample.json',
fileSize: '28 B',
},
},
json: {},
},
{
binary: {
data: {
mimeType: 'application/json',
fileType: 'json',
fileExtension: 'json',
data: 'ewoJInRpdGxlIjogIklwc3VtIExvcmVtIgp9Cg==',
fileName: 'sample2.json',
fileSize: '28 B',
},
},
json: {},
},
],
],
},
},
},
];
for (const testData of tests) {
testHarness.setupTest(testData);
}
});

View File

@@ -0,0 +1,45 @@
{
"name": "Read Binary Files test",
"nodes": [
{
"parameters": {},
"id": "90c8a569-5351-44a4-9073-b8d114108676",
"name": "When clicking \"Execute Workflow\"",
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [680, 640]
},
{
"parameters": {
"fileSelector": "C:/Test/data/*.json"
},
"id": "b4974ce2-9bc8-4242-b6f9-86b43608b521",
"name": "Read Binary Files",
"type": "n8n-nodes-base.readBinaryFiles",
"typeVersion": 1,
"position": [880, 640]
}
],
"pinData": {},
"connections": {
"When clicking \"Execute Workflow\"": {
"main": [
[
{
"node": "Read Binary Files",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"versionId": "973f1d06-f5e6-4e05-8136-02f6518ad37b",
"id": "190",
"meta": {
"instanceId": "104a4d08d8897b8bdeb38aaca515021075e0bd8544c983c2bb8c86e6a8e6081c"
},
"tags": []
}

View File

@@ -0,0 +1,3 @@
{
"title": "Lorem Ipsum"
}

View File

@@ -0,0 +1,3 @@
{
"title": "Ipsum Lorem"
}