mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
chore: Upgrade nock and delete nock related boilerplate code (no-changelog) (#12869)
This commit is contained in:
committed by
GitHub
parent
0bb65f27ab
commit
f64c6bf9ac
5
packages/nodes-base/test/globalSetup.ts
Normal file
5
packages/nodes-base/test/globalSetup.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import nock from 'nock';
|
||||
|
||||
export default async () => {
|
||||
nock.disableNetConnect();
|
||||
};
|
||||
@@ -17,16 +17,11 @@ const records = [
|
||||
|
||||
describe('Execute Airtable Node', () => {
|
||||
beforeEach(() => {
|
||||
nock.disableNetConnect();
|
||||
nock('https://api.airtable.com/v0')
|
||||
.get('/appIaXXdDqS5ORr4V/tbljyBEdYzCPF0NDh?pageSize=100')
|
||||
.reply(200, { records });
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
nock.restore();
|
||||
});
|
||||
|
||||
const tests: WorkflowTestData[] = [
|
||||
{
|
||||
description: 'List Airtable Records',
|
||||
|
||||
@@ -36,7 +36,6 @@ import type {
|
||||
WorkflowTestData,
|
||||
} from 'n8n-workflow';
|
||||
import { ApplicationError, ICredentialsHelper, NodeHelpers, WorkflowHooks } from 'n8n-workflow';
|
||||
import nock from 'nock';
|
||||
import { tmpdir } from 'os';
|
||||
import path from 'path';
|
||||
|
||||
@@ -225,16 +224,6 @@ export function setup(testData: WorkflowTestData[] | WorkflowTestData) {
|
||||
testData = [testData];
|
||||
}
|
||||
|
||||
if (testData.some((t) => !!t.nock)) {
|
||||
beforeAll(() => {
|
||||
nock.disableNetConnect();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
nock.restore();
|
||||
});
|
||||
}
|
||||
|
||||
const nodeTypes = new NodeTypes();
|
||||
|
||||
const nodes = [...new Set(testData.flatMap((data) => data.input.workflowData.nodes))];
|
||||
@@ -383,7 +372,6 @@ export const workflowToTests = (workflowFiles: string[]) => {
|
||||
|
||||
export const testWorkflows = (workflows: string[]) => {
|
||||
const tests = workflowToTests(workflows);
|
||||
|
||||
const nodeTypes = setup(tests);
|
||||
|
||||
for (const testData of tests) {
|
||||
|
||||
Reference in New Issue
Block a user