chore: Upgrade nock and delete nock related boilerplate code (no-changelog) (#12869)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-01-27 18:17:51 +01:00
committed by GitHub
parent 0bb65f27ab
commit f64c6bf9ac
154 changed files with 75 additions and 1483 deletions

View File

@@ -1,5 +1,4 @@
import type { IHttpRequestMethods } from 'n8n-workflow';
import nock from 'nock';
import { equalityTest, setup, workflowToTests } from '@test/nodes/Helpers';
@@ -22,16 +21,6 @@ jest.mock('../../../../V2/GenericFunctions', () => {
describe('Test SlackV2, channel => append', () => {
const workflows = ['nodes/Slack/test/v2/node/channel/archive.workflow.json'];
const tests = workflowToTests(workflows);
beforeAll(() => {
nock.disableNetConnect();
});
afterAll(() => {
nock.restore();
jest.unmock('../../../../V2/GenericFunctions');
});
const nodeTypes = setup(tests);
for (const testData of tests) {

View File

@@ -1,5 +1,4 @@
import type { IHttpRequestMethods, INodeTypes, WorkflowTestData } from 'n8n-workflow';
import nock from 'nock';
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
@@ -64,16 +63,6 @@ jest.mock('../../../../V2/GenericFunctions', () => {
describe('Test SlackV2, channel => create', () => {
const workflows = ['nodes/Slack/test/v2/node/channel/create.workflow.json'];
const tests = workflowToTests(workflows);
beforeAll(() => {
nock.disableNetConnect();
});
afterAll(() => {
nock.restore();
jest.unmock('../../../../V2/GenericFunctions');
});
const nodeTypes = setup(tests);
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {

View File

@@ -1,5 +1,4 @@
import type { IHttpRequestMethods, INodeTypes, WorkflowTestData } from 'n8n-workflow';
import nock from 'nock';
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
@@ -63,16 +62,6 @@ jest.mock('../../../../V2/GenericFunctions', () => {
describe('Test SlackV2, channel => get', () => {
const workflows = ['nodes/Slack/test/v2/node/channel/get.workflow.json'];
const tests = workflowToTests(workflows);
beforeAll(() => {
nock.disableNetConnect();
});
afterAll(() => {
nock.restore();
jest.unmock('../../../../V2/GenericFunctions');
});
const nodeTypes = setup(tests);
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {

View File

@@ -1,5 +1,4 @@
import type { IHttpRequestMethods, INodeTypes, WorkflowTestData } from 'n8n-workflow';
import nock from 'nock';
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
@@ -126,16 +125,6 @@ jest.mock('../../../../V2/GenericFunctions', () => {
describe('Test SlackV2, channel => getAll', () => {
const workflows = ['nodes/Slack/test/v2/node/channel/getAll.workflow.json'];
const tests = workflowToTests(workflows);
beforeAll(() => {
nock.disableNetConnect();
});
afterAll(() => {
nock.restore();
jest.unmock('../../../../V2/GenericFunctions');
});
const nodeTypes = setup(tests);
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {

View File

@@ -1,5 +1,4 @@
import type { IHttpRequestMethods, INodeTypes, WorkflowTestData } from 'n8n-workflow';
import nock from 'nock';
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
@@ -182,16 +181,6 @@ jest.mock('../../../../V2/GenericFunctions', () => {
describe('Test SlackV2, channel => history', () => {
const workflows = ['nodes/Slack/test/v2/node/channel/history.workflow.json'];
const tests = workflowToTests(workflows);
beforeAll(() => {
nock.disableNetConnect();
});
afterAll(() => {
nock.restore();
jest.unmock('../../../../V2/GenericFunctions');
});
const nodeTypes = setup(tests);
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {

View File

@@ -1,5 +1,4 @@
import type { IHttpRequestMethods, INodeTypes, WorkflowTestData } from 'n8n-workflow';
import nock from 'nock';
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
@@ -26,16 +25,6 @@ jest.mock('../../../../V2/GenericFunctions', () => {
describe('Test SlackV2, file => upload', () => {
const workflows = ['nodes/Slack/test/v2/node/file/upload.workflow.json'];
const tests = workflowToTests(workflows);
beforeAll(() => {
nock.disableNetConnect();
});
afterAll(() => {
nock.restore();
jest.unmock('../../../../V2/GenericFunctions');
});
const nodeTypes = setup(tests);
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {

View File

@@ -1,5 +1,4 @@
import type { IHttpRequestMethods, INodeTypes, WorkflowTestData } from 'n8n-workflow';
import nock from 'nock';
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
@@ -27,16 +26,6 @@ jest.mock('../../../../V2/GenericFunctions', () => {
describe('Test SlackV2, message => delete', () => {
const workflows = ['nodes/Slack/test/v2/node/message/delete.workflow.json'];
const tests = workflowToTests(workflows);
beforeAll(() => {
nock.disableNetConnect();
});
afterAll(() => {
nock.restore();
jest.unmock('../../../../V2/GenericFunctions');
});
const nodeTypes = setup(tests);
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {

View File

@@ -1,5 +1,4 @@
import type { IHttpRequestMethods, INodeTypes, WorkflowTestData } from 'n8n-workflow';
import nock from 'nock';
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
@@ -27,16 +26,6 @@ jest.mock('../../../../V2/GenericFunctions', () => {
describe('Test SlackV2, message => getPermalink', () => {
const workflows = ['nodes/Slack/test/v2/node/message/getPermalink.workflow.json'];
const tests = workflowToTests(workflows);
beforeAll(() => {
nock.disableNetConnect();
});
afterAll(() => {
nock.restore();
jest.unmock('../../../../V2/GenericFunctions');
});
const nodeTypes = setup(tests);
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {

View File

@@ -1,5 +1,4 @@
import type { IHttpRequestMethods, INodeTypes, WorkflowTestData } from 'n8n-workflow';
import nock from 'nock';
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
@@ -66,16 +65,6 @@ jest.mock('../../../../V2/GenericFunctions', () => {
describe('Test SlackV2, message => post', () => {
const workflows = ['nodes/Slack/test/v2/node/message/post.workflow.json'];
const tests = workflowToTests(workflows);
beforeAll(() => {
nock.disableNetConnect();
});
afterAll(() => {
nock.restore();
jest.unmock('../../../../V2/GenericFunctions');
});
const nodeTypes = setup(tests);
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {

View File

@@ -1,5 +1,4 @@
import type { IHttpRequestMethods, INodeTypes, WorkflowTestData } from 'n8n-workflow';
import nock from 'nock';
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
@@ -219,16 +218,6 @@ jest.mock('../../../../V2/GenericFunctions', () => {
describe('Test SlackV2, message => search', () => {
const workflows = ['nodes/Slack/test/v2/node/message/search.workflow.json'];
const tests = workflowToTests(workflows);
beforeAll(() => {
nock.disableNetConnect();
});
afterAll(() => {
nock.restore();
jest.unmock('../../../../V2/GenericFunctions');
});
const nodeTypes = setup(tests);
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {

View File

@@ -1,5 +1,4 @@
import type { IHttpRequestMethods, INodeTypes, WorkflowTestData } from 'n8n-workflow';
import nock from 'nock';
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
@@ -70,16 +69,6 @@ jest.mock('../../../../V2/GenericFunctions', () => {
describe('Test SlackV2, message => update', () => {
const workflows = ['nodes/Slack/test/v2/node/message/update.workflow.json'];
const tests = workflowToTests(workflows);
beforeAll(() => {
nock.disableNetConnect();
});
afterAll(() => {
nock.restore();
jest.unmock('../../../../V2/GenericFunctions');
});
const nodeTypes = setup(tests);
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {

View File

@@ -1,5 +1,4 @@
import type { INodeTypes, WorkflowTestData } from 'n8n-workflow';
import nock from 'nock';
import { getResultNodeData, setup, workflowToTests } from '@test/nodes/Helpers';
@@ -21,16 +20,6 @@ jest.mock('../../../../V2/GenericFunctions', () => {
describe('Test SlackV2, user => updateProfile', () => {
const workflows = ['nodes/Slack/test/v2/node/user/updateProfile.workflow.json'];
const tests = workflowToTests(workflows);
beforeAll(() => {
nock.disableNetConnect();
});
afterAll(() => {
nock.restore();
jest.unmock('../../../../V2/GenericFunctions');
});
const nodeTypes = setup(tests);
const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {