mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
35 lines
835 B
TypeScript
35 lines
835 B
TypeScript
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
|
|
import type { WorkflowTestData } from 'n8n-workflow';
|
|
import nock from 'nock';
|
|
|
|
const record = {
|
|
id: 'rec2BWBoyS5QsS7pT',
|
|
name: 'Tim',
|
|
email: 'tim@email.com',
|
|
createdTime: '2022-08-25T08:22:34.000Z',
|
|
};
|
|
|
|
describe('Execute Airtable Node', () => {
|
|
const testHarness = new NodeTestHarness();
|
|
|
|
beforeEach(() => {
|
|
nock('https://api.airtable.com/v0')
|
|
.get('/appIaXXdDqS5ORr4V/tbljyBEdYzCPF0NDh/rec2BWBoyS5QsS7pT')
|
|
.reply(200, record);
|
|
});
|
|
|
|
const testData: WorkflowTestData = {
|
|
description: 'List Airtable Records',
|
|
input: {
|
|
workflowData: testHarness.readWorkflowJSON('workflow.json'),
|
|
},
|
|
output: {
|
|
nodeData: {
|
|
Airtable: [[{ json: record }]],
|
|
},
|
|
},
|
|
};
|
|
|
|
testHarness.setupTest(testData, { credentials: { airtableTokenApi: {} } });
|
|
});
|