mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
chore: Upgrade nock and delete nock related boilerplate code (no-changelog) (#12869)
This commit is contained in:
parent
0bb65f27ab
commit
f64c6bf9ac
|
@ -58,7 +58,7 @@
|
|||
"jest-mock": "^29.6.2",
|
||||
"jest-mock-extended": "^3.0.4",
|
||||
"lefthook": "^1.7.15",
|
||||
"nock": "^13.3.2",
|
||||
"nock": "^14.0.0",
|
||||
"nodemon": "^3.0.1",
|
||||
"npm-run-all2": "^7.0.2",
|
||||
"p-limit": "^3.1.0",
|
||||
|
|
|
@ -474,7 +474,7 @@ describe('NodeExecuteFunctions', () => {
|
|||
body: 'Not Found',
|
||||
headers: {},
|
||||
statusCode: 404,
|
||||
statusMessage: null,
|
||||
statusMessage: 'Not Found',
|
||||
});
|
||||
expect(hooks.executeHookFunctions).toHaveBeenCalledWith('nodeFetchedData', [
|
||||
workflow.id,
|
||||
|
|
|
@ -5,6 +5,7 @@ process.env.TZ = 'UTC';
|
|||
module.exports = {
|
||||
...require('../../jest.config'),
|
||||
collectCoverageFrom: ['credentials/**/*.ts', 'nodes/**/*.ts', 'utils/**/*.ts'],
|
||||
globalSetup: '<rootDir>/test/globalSetup.ts',
|
||||
setupFilesAfterEnv: [
|
||||
'jest-expect-message',
|
||||
'n8n-workflow/test/setup.ts',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as getMany from '../../../../v2/actions/base/getMany.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction } from '../helpers';
|
||||
|
@ -33,15 +31,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('Test AirtableV2, base => getMany', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should return all bases', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'base',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as getSchema from '../../../../v2/actions/base/getSchema.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('Test AirtableV2, base => getSchema', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should return all bases', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'base',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as create from '../../../../v2/actions/record/create.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction } from '../helpers';
|
||||
|
@ -15,18 +13,7 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('Test AirtableV2, create operation', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
beforeEach(() => jest.clearAllMocks());
|
||||
|
||||
it('should create a record, autoMapInputData', async () => {
|
||||
const nodeParameters = {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as deleteRecord from '../../../../v2/actions/record/deleteRecord.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction } from '../helpers';
|
||||
|
@ -15,19 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('Test AirtableV2, deleteRecord operation', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should delete a record', async () => {
|
||||
const nodeParameters = {
|
||||
operation: 'deleteRecord',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as get from '../../../../v2/actions/record/get.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction } from '../helpers';
|
||||
|
@ -23,19 +21,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('Test AirtableV2, create operation', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should create a record, autoMapInputData', async () => {
|
||||
const nodeParameters = {
|
||||
operation: 'get',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as search from '../../../../v2/actions/record/search.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction } from '../helpers';
|
||||
|
@ -49,15 +47,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('Test AirtableV2, search operation', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should return all records', async () => {
|
||||
const nodeParameters = {
|
||||
operation: 'search',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as update from '../../../../v2/actions/record/update.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction } from '../helpers';
|
||||
|
@ -40,15 +38,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('Test AirtableV2, update operation', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should update a record by id, autoMapInputData', async () => {
|
||||
const nodeParameters = {
|
||||
operation: 'update',
|
||||
|
|
|
@ -25,7 +25,6 @@ describe('Test AWS Comprehend Node', () => {
|
|||
|
||||
await initBinaryDataService();
|
||||
|
||||
nock.disableNetConnect();
|
||||
const baseUrl = 'https://comprehend.eu-central-1.amazonaws.com';
|
||||
|
||||
mock = nock(baseUrl);
|
||||
|
@ -34,9 +33,6 @@ describe('Test AWS Comprehend Node', () => {
|
|||
beforeEach(async () => {
|
||||
mock.post('/').reply(200, response);
|
||||
});
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
testWorkflows(workflows);
|
||||
});
|
||||
|
|
|
@ -291,7 +291,6 @@ describe('Test AWS Rekogntion Node', () => {
|
|||
let mock: nock.Scope;
|
||||
|
||||
beforeAll(async () => {
|
||||
nock.disableNetConnect();
|
||||
mock = nock(baseUrl);
|
||||
});
|
||||
|
||||
|
@ -299,9 +298,6 @@ describe('Test AWS Rekogntion Node', () => {
|
|||
mock.post('/').reply(200, responseLabels);
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
testWorkflows(workflows);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -14,7 +14,6 @@ describe('Test S3 V1 Node', () => {
|
|||
|
||||
await initBinaryDataService();
|
||||
|
||||
nock.disableNetConnect();
|
||||
mock = nock('https://bucket.s3.eu-central-1.amazonaws.com');
|
||||
});
|
||||
|
||||
|
@ -40,10 +39,6 @@ describe('Test S3 V1 Node', () => {
|
|||
.reply(200, { success: true });
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
testWorkflows(workflows);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -14,7 +14,6 @@ describe('Test S3 V2 Node', () => {
|
|||
|
||||
await initBinaryDataService();
|
||||
|
||||
nock.disableNetConnect();
|
||||
mock = nock('https://s3.eu-central-1.amazonaws.com/buc.ket');
|
||||
});
|
||||
|
||||
|
@ -40,10 +39,6 @@ describe('Test S3 V2 Node', () => {
|
|||
.reply(200, { success: true });
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
testWorkflows(workflows);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -33,10 +33,6 @@ describe('Cron Node', () => {
|
|||
},
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
it('should return a function to trigger', async () => {
|
||||
expect(await node.trigger.call(triggerFunctions)).toEqual({
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -31,16 +30,6 @@ discordApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test DiscordV2, channel => create', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/channel/create.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -31,16 +30,6 @@ discordApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test DiscordV2, channel => deleteChannel', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/channel/deleteChannel.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes, IRequestOptions } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -46,16 +45,6 @@ requestApiSpy.mockImplementation(
|
|||
describe('Test DiscordV2, channel => get', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/channel/get.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -107,16 +106,6 @@ discordApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test DiscordV2, channel => getAll', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/channel/getAll.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -31,16 +30,6 @@ discordApiRequestSpy.mockImplementation(async (method: string, _) => {
|
|||
describe('Test DiscordV2, channel => update', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/channel/update.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -54,16 +53,6 @@ discordApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test DiscordV2, member => getAll', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/member/getAll.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -20,16 +19,6 @@ discordApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test DiscordV2, member => roleAdd', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/member/roleAdd.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -20,16 +19,6 @@ discordApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test DiscordV2, member => roleRemove', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/member/roleRemove.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -20,16 +19,6 @@ discordApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test DiscordV2, message => deleteMessage', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/message/deleteMessage.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -39,16 +38,6 @@ discordApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test DiscordV2, message => get', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/message/get.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -62,16 +61,6 @@ discordApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test DiscordV2, message => getAll', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/message/getAll.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -20,16 +19,6 @@ discordApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test DiscordV2, message => react', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/message/react.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -61,16 +60,6 @@ discordApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test DiscordV2, message => send', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/message/send.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -55,16 +54,6 @@ discordApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test DiscordV2, webhook => sendLegacy', () => {
|
||||
const workflows = ['nodes/Discord/test/v2/node/webhook/sendLegacy.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -125,10 +125,6 @@ describe('Test Discord > setupChannelGetter & checkAccessToChannel', () => {
|
|||
}
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it('should setup channel getter and get channel id', async () => {
|
||||
const fakeExecuteFunction = (auth: string) => {
|
||||
return {
|
||||
|
|
|
@ -91,7 +91,7 @@ export class EmailSendV2 implements INodeType {
|
|||
|
||||
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
|
||||
let returnData: INodeExecutionData[][] = [];
|
||||
const operation = this.getNodeParameter('operation', 0) as string;
|
||||
const operation = this.getNodeParameter('operation', 0);
|
||||
|
||||
if (operation === SEND_AND_WAIT_OPERATION) {
|
||||
returnData = await sendAndWait.execute.call(this);
|
||||
|
|
|
@ -125,8 +125,6 @@ describe('Gong Node', () => {
|
|||
];
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
|
||||
jest
|
||||
.spyOn(Helpers.CredentialsHelper.prototype, 'authenticate')
|
||||
.mockImplementation(
|
||||
|
@ -161,11 +159,6 @@ describe('Gong Node', () => {
|
|||
);
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
nock(baseUrl)
|
||||
.post('/v2/calls/extensive', { filter: { callIds: ['7782342274025937895'] } })
|
||||
.matchHeader(
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -33,16 +32,6 @@ jest.mock('../../../v2/transport', () => {
|
|||
describe('Test Google BigQuery V2, executeQuery', () => {
|
||||
const workflows = ['nodes/Google/BigQuery/test/v2/node/executeQuery.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -41,16 +40,6 @@ jest.mock('../../../v2/transport', () => {
|
|||
describe('Test Google BigQuery V2, insert auto map', () => {
|
||||
const workflows = ['nodes/Google/BigQuery/test/v2/node/insert.autoMapMode.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -42,16 +41,6 @@ jest.mock('../../../v2/transport', () => {
|
|||
describe('Test Google BigQuery V2, insert define manually', () => {
|
||||
const workflows = ['nodes/Google/BigQuery/test/v2/node/insert.manualMode.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -435,10 +435,10 @@ export class GoogleCalendar implements INodeType {
|
|||
const timeMin = dateObjectToISO(this.getNodeParameter('timeMin', i));
|
||||
const timeMax = dateObjectToISO(this.getNodeParameter('timeMax', i));
|
||||
if (timeMin) {
|
||||
qs.timeMin = addTimezoneToDate(timeMin as string, tz || timezone);
|
||||
qs.timeMin = addTimezoneToDate(timeMin, tz || timezone);
|
||||
}
|
||||
if (timeMax) {
|
||||
qs.timeMax = addTimezoneToDate(timeMax as string, tz || timezone);
|
||||
qs.timeMax = addTimezoneToDate(timeMax, tz || timezone);
|
||||
}
|
||||
|
||||
if (!options.recurringEventHandling || options.recurringEventHandling === 'expand') {
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as create from '../../../../v2/actions/drive/create.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -25,15 +23,6 @@ jest.mock('uuid', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: drive create', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'drive',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as deleteDrive from '../../../../v2/actions/drive/deleteDrive.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: drive deleteDrive', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'drive',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as get from '../../../../v2/actions/drive/get.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: drive get', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'drive',
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import * as list from '../../../../v2/actions/drive/list.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
@ -23,15 +22,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: drive list', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with limit', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'drive',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as update from '../../../../v2/actions/drive/update.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: drive update', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'drive',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as copy from '../../../../v2/actions/file/copy.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: file copy', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
operation: 'copy',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as createFromText from '../../../../v2/actions/file/createFromText.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: file createFromText', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
operation: 'createFromText',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as deleteFile from '../../../../v2/actions/file/deleteFile.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: file deleteFile', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
operation: 'deleteFile',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as download from '../../../../v2/actions/file/download.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: file download', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
operation: 'deleteFile',
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import * as move from '../../../../v2/actions/file/move.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
@ -21,15 +20,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: file move', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
operation: 'move',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as share from '../../../../v2/actions/file/share.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: file share', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
operation: 'share',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as update from '../../../../v2/actions/file/update.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: file update', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
operation: 'update',
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import * as upload from '../../../../v2/actions/file/upload.operation';
|
||||
import * as utils from '../../../../v2/helpers/utils';
|
||||
|
@ -37,20 +36,10 @@ jest.mock('../../../../v2/helpers/utils', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: file upload', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
jest.unmock('../../../../v2/helpers/utils');
|
||||
});
|
||||
|
||||
it('should upload buffers', async () => {
|
||||
const nodeParameters = {
|
||||
name: 'newFile.txt',
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import * as search from '../../../../v2/actions/fileFolder/search.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
|
@ -23,15 +22,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: fileFolder search', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('returnAll = false', async () => {
|
||||
const nodeParameters = {
|
||||
searchMethod: 'name',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as create from '../../../../v2/actions/folder/create.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: folder create', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'folder',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as deleteFolder from '../../../../v2/actions/folder/deleteFolder.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: folder deleteFolder', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with PATCH', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'folder',
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import nock from 'nock';
|
||||
|
||||
import * as share from '../../../../v2/actions/folder/share.operation';
|
||||
import * as transport from '../../../../v2/transport';
|
||||
import { createMockExecuteFunction, driveNode } from '../helpers';
|
||||
|
@ -15,15 +13,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
});
|
||||
|
||||
describe('test GoogleDriveV2: folder share', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
it('should be called with', async () => {
|
||||
const nodeParameters = {
|
||||
resource: 'folder',
|
||||
|
|
|
@ -42,8 +42,6 @@ describe('GmailTrigger', () => {
|
|||
}
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
|
||||
jest.spyOn(mailparser, 'simpleParser').mockResolvedValue({
|
||||
headers: new Map([['headerKey', 'headerValue']]),
|
||||
attachments: [],
|
||||
|
@ -63,10 +61,6 @@ describe('GmailTrigger', () => {
|
|||
});
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
it('should return incoming emails', async () => {
|
||||
const messageListResponse: MessageListResponse = {
|
||||
messages: [createListMessage({ id: '1' }), createListMessage({ id: '2' })],
|
||||
|
|
|
@ -14,13 +14,6 @@ describe('Test Gmail Node v2', () => {
|
|||
jest
|
||||
.useFakeTimers({ doNotFake: ['setImmediate', 'nextTick'] })
|
||||
.setSystemTime(new Date('2024-12-16 12:34:56.789Z'));
|
||||
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('Messages', () => {
|
||||
|
|
|
@ -17,7 +17,6 @@ describe('GraphQL Node', () => {
|
|||
|
||||
beforeAll(async () => {
|
||||
await initBinaryDataService();
|
||||
nock.disableNetConnect();
|
||||
|
||||
nock(baseUrl)
|
||||
.matchHeader('accept', 'application/json')
|
||||
|
@ -71,10 +70,6 @@ describe('GraphQL Node', () => {
|
|||
});
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(workflowTests);
|
||||
|
||||
for (const workflow of workflowTests) {
|
||||
|
|
|
@ -17,8 +17,6 @@ describe('Test Binary Data Download', () => {
|
|||
beforeAll(async () => {
|
||||
await initBinaryDataService();
|
||||
|
||||
nock.disableNetConnect();
|
||||
|
||||
nock(baseUrl)
|
||||
.persist()
|
||||
.get('/path/to/image.png')
|
||||
|
@ -33,11 +31,6 @@ describe('Test Binary Data Download', () => {
|
|||
'content-disposition': 'attachment; filename="testing.jpg"',
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
|
|
|
@ -21,18 +21,11 @@ describe('Test Response Encoding', () => {
|
|||
beforeAll(async () => {
|
||||
await initBinaryDataService();
|
||||
|
||||
nock.disableNetConnect();
|
||||
|
||||
nock(baseUrl)
|
||||
.persist()
|
||||
.get('/index.html')
|
||||
.reply(200, payload, { 'content-type': 'text/plain; charset=latin1' });
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
|
|
|
@ -21,18 +21,11 @@ describe('Test Quoted Response Encoding', () => {
|
|||
beforeAll(async () => {
|
||||
await initBinaryDataService();
|
||||
|
||||
nock.disableNetConnect();
|
||||
|
||||
nock(baseUrl)
|
||||
.persist()
|
||||
.get('/index.html')
|
||||
.reply(200, payload, { 'content-type': 'text/plain; charset="latin1"' });
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
|
|
|
@ -17,7 +17,6 @@ describe('Test HTTP Request Node', () => {
|
|||
|
||||
beforeAll(async () => {
|
||||
await initBinaryDataService();
|
||||
nock.disableNetConnect();
|
||||
|
||||
function getPaginationReturnData(this: nock.ReplyFnContext, limit = 10, skip = 0) {
|
||||
const nextUrl = `${baseUrl}/users?skip=${skip + limit}&limit=${limit}`;
|
||||
|
@ -192,11 +191,6 @@ describe('Test HTTP Request Node', () => {
|
|||
return getPaginationReturnData.call(this, limit, skip);
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
|
|
|
@ -1266,7 +1266,7 @@
|
|||
"next-url": "https://dummyjson.com/users?skip=4&limit=4"
|
||||
},
|
||||
"statusCode": 200,
|
||||
"statusMessage": null
|
||||
"statusMessage": "OK"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1277,7 +1277,7 @@
|
|||
"next-url": "https://dummyjson.com/users?skip=8&limit=4"
|
||||
},
|
||||
"statusCode": 200,
|
||||
"statusMessage": null
|
||||
"statusMessage": "OK"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1288,7 +1288,7 @@
|
|||
"next-url": "https://dummyjson.com/users?skip=12&limit=4"
|
||||
},
|
||||
"statusCode": 200,
|
||||
"statusMessage": null
|
||||
"statusMessage": "OK"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1299,7 +1299,7 @@
|
|||
"next-url": "https://dummyjson.com/users?skip=16&limit=4"
|
||||
},
|
||||
"statusCode": 200,
|
||||
"statusMessage": null
|
||||
"statusMessage": "OK"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1310,7 +1310,7 @@
|
|||
"next-url": "https://dummyjson.com/users?skip=20&limit=4"
|
||||
},
|
||||
"statusCode": 404,
|
||||
"statusMessage": null
|
||||
"statusMessage": "Not Found"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -1532,7 +1532,7 @@
|
|||
"next-url": "https://dummyjson.com/users?skip=4&limit=4"
|
||||
},
|
||||
"statusCode": 200,
|
||||
"statusMessage": null
|
||||
"statusMessage": "OK"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1543,7 +1543,7 @@
|
|||
"next-url": "https://dummyjson.com/users?skip=8&limit=4"
|
||||
},
|
||||
"statusCode": 200,
|
||||
"statusMessage": null
|
||||
"statusMessage": "OK"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1554,7 +1554,7 @@
|
|||
"next-url": "https://dummyjson.com/users?skip=12&limit=4"
|
||||
},
|
||||
"statusCode": 200,
|
||||
"statusMessage": null
|
||||
"statusMessage": "OK"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1565,7 +1565,7 @@
|
|||
"next-url": "https://dummyjson.com/users?skip=16&limit=4"
|
||||
},
|
||||
"statusCode": 200,
|
||||
"statusMessage": null
|
||||
"statusMessage": "OK"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1576,7 +1576,7 @@
|
|||
"next-url": "https://dummyjson.com/users?skip=20&limit=4"
|
||||
},
|
||||
"statusCode": 404,
|
||||
"statusMessage": null
|
||||
"statusMessage": "Not Found"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
@ -43,7 +43,6 @@ describe('Execute iCalendar Node', () => {
|
|||
},
|
||||
},
|
||||
];
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
|
|
|
@ -11,8 +11,6 @@ import {
|
|||
describe('MailerLite', () => {
|
||||
describe('Run v1 workflow', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
|
||||
const mock = nock('https://api.mailerlite.com/api/v2');
|
||||
|
||||
mock.post('/subscribers').reply(200, getCreateResponseClassic);
|
||||
|
@ -21,10 +19,6 @@ describe('MailerLite', () => {
|
|||
mock.put('/subscribers/demo@mailerlite.com').reply(200, getUpdateSubscriberResponseClassic);
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
testWorkflows(workflows);
|
||||
});
|
||||
|
|
|
@ -11,8 +11,6 @@ import {
|
|||
describe('MailerLite', () => {
|
||||
describe('Run v2 workflow', () => {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
|
||||
const mock = nock('https://connect.mailerlite.com/api');
|
||||
|
||||
mock.post('/subscribers').reply(200, getCreateResponseV2);
|
||||
|
@ -24,10 +22,6 @@ describe('MailerLite', () => {
|
|||
mock.put('/subscribers/user@n8n.io').reply(200, getUpdateSubscriberResponseV2);
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
const workflows = getWorkflowFilenames(__dirname);
|
||||
testWorkflows(workflows);
|
||||
});
|
||||
|
|
|
@ -91,8 +91,6 @@ describe('Gong Node', () => {
|
|||
];
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
|
||||
jest
|
||||
.spyOn(Helpers.CredentialsHelper.prototype, 'authenticate')
|
||||
.mockImplementation(
|
||||
|
@ -116,11 +114,6 @@ describe('Gong Node', () => {
|
|||
);
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
nock(baseUrl)
|
||||
.get(`/groups/${microsoftEntraApiResponse.getGroup.id}`)
|
||||
.matchHeader(
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -34,16 +33,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, table => addTable', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/table/addTable.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -51,16 +50,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, table => append', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/table/append.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -31,16 +30,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, table => convertToRange', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/table/convertToRange.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -22,16 +21,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, table => deleteTable', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/table/deleteTable.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -33,16 +32,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, table => getColumns', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/table/getColumns.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -49,16 +48,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, table => getRows', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/table/getRows.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -67,16 +66,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, table => lookup', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/table/lookup.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -35,16 +34,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, workbook => addWorksheet', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/workbook/addWorksheet.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -22,16 +21,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, workbook => deleteWorkbook', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/workbook/deleteWorkbook.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -35,16 +34,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, workbook => getAll', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/workbook/getAll.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
||||
|
@ -38,16 +37,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, worksheet => append', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/worksheet/append.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -30,16 +29,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, worksheet => clear', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/worksheet/clear.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -30,16 +29,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, worksheet => deleteWorksheet', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/worksheet/deleteWorksheet.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods, INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -37,16 +36,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, worksheet => getAll', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/worksheet/getAll.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
||||
|
@ -35,16 +34,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, worksheet => readRows', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/worksheet/readRows.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
||||
|
@ -48,16 +47,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, worksheet => update', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/worksheet/update.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { IHttpRequestMethods } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
||||
|
@ -50,16 +49,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftExcelV2, worksheet => upsert', () => {
|
||||
const workflows = ['nodes/Microsoft/Excel/test/v2/node/worksheet/upsert.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -42,16 +41,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, calendar => create', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/calendar/create.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -22,16 +21,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, calendar => delete', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/calendar/delete.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -42,16 +41,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, calendar => get', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/calendar/get.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -63,16 +62,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, calendar => getAll', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/calendar/getAll.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -42,16 +41,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, calendar => update', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/calendar/update.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -65,16 +64,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, contact => create', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/contact/create.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -71,16 +70,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, contact => update', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/contact/update.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -93,16 +92,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, draft => create', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/draft/create.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -22,16 +21,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, draft => send', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/draft/send.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -103,16 +102,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, contact => event', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/event/create.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -34,16 +33,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, contact => folder', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/folder/create.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -27,16 +26,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, folderMessage => getAll', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/folderMessage/getAll.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -22,16 +21,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, message => move', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/message/move.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -82,16 +81,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, message => reply', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/message/reply.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -22,16 +21,6 @@ jest.mock('../../../../v2/transport', () => {
|
|||
describe('Test MicrosoftOutlookV2, message => send', () => {
|
||||
const workflows = ['nodes/Microsoft/Outlook/test/v2/node/message/send.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.unmock('../../../../v2/transport');
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -30,16 +29,6 @@ microsoftApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test MicrosoftTeamsV2, channel => create', () => {
|
||||
const workflows = ['nodes/Microsoft/Teams/test/v2/node/channel/create.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -18,16 +17,6 @@ microsoftApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test MicrosoftTeamsV2, channel => deleteChannel', () => {
|
||||
const workflows = ['nodes/Microsoft/Teams/test/v2/node/channel/deleteChannel.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { INodeTypes } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
|
||||
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
|
||||
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
|
||||
|
@ -31,16 +30,6 @@ microsoftApiRequestSpy.mockImplementation(async (method: string) => {
|
|||
describe('Test MicrosoftTeamsV2, channel => get', () => {
|
||||
const workflows = ['nodes/Microsoft/Teams/test/v2/node/channel/get.workflow.json'];
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue