Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('Test AirtableV2, base => getMany', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should return all bases', async () => {
const nodeParameters = {
resource: 'base',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('Test AirtableV2, base => getSchema', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should return all bases', async () => {
const nodeParameters = {
resource: 'base',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,7 @@ jest.mock('../../../../v2/transport', () => {
});

describe('Test AirtableV2, create operation', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

afterEach(() => {
jest.restoreAllMocks();
});
beforeEach(() => jest.clearAllMocks());
dana-gill marked this conversation as resolved.
Show resolved Hide resolved

it('should create a record, autoMapInputData', async () => {
const nodeParameters = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('Test AirtableV2, deleteRecord operation', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

afterEach(() => {
jest.restoreAllMocks();
});

it('should delete a record', async () => {
const nodeParameters = {
operation: 'deleteRecord',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('Test AirtableV2, create operation', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

afterEach(() => {
jest.restoreAllMocks();
});

it('should create a record, autoMapInputData', async () => {
const nodeParameters = {
operation: 'get',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('Test AirtableV2, search operation', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should return all records', async () => {
const nodeParameters = {
operation: 'search',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('Test AirtableV2, update operation', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should update a record by id, autoMapInputData', async () => {
const nodeParameters = {
operation: 'update',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ requestApiSpy.mockImplementation(
describe('Test DiscordV2, channel => get', () => {
const workflows = ['nodes/Discord/test/v2/node/channel/get.workflow.json'];
const tests = workflowToTests(workflows);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +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);

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
4 changes: 0 additions & 4 deletions packages/nodes-base/nodes/Discord/test/v2/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +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);

afterAll(() => {
jest.unmock('../../../v2/transport');
});

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +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);

afterAll(() => {
jest.unmock('../../../v2/transport');
});

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +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);

afterAll(() => {
jest.unmock('../../../v2/transport');
});

const nodeTypes = setup(tests);

const testNode = async (testData: WorkflowTestData, types: INodeTypes) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ jest.mock('uuid', () => {
});

describe('test GoogleDriveV2: drive create', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should be called with', async () => {
const nodeParameters = {
resource: 'drive',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('test GoogleDriveV2: drive deleteDrive', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should be called with', async () => {
const nodeParameters = {
resource: 'drive',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('test GoogleDriveV2: drive get', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should be called with', async () => {
const nodeParameters = {
resource: 'drive',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('test GoogleDriveV2: drive list', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should be called with limit', async () => {
const nodeParameters = {
resource: 'drive',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('test GoogleDriveV2: drive update', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should be called with', async () => {
const nodeParameters = {
resource: 'drive',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('test GoogleDriveV2: file copy', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should be called with', async () => {
const nodeParameters = {
operation: 'copy',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('test GoogleDriveV2: file createFromText', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should be called with', async () => {
const nodeParameters = {
operation: 'createFromText',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('test GoogleDriveV2: file deleteFile', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should be called with', async () => {
const nodeParameters = {
operation: 'deleteFile',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('test GoogleDriveV2: file download', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should be called with', async () => {
const nodeParameters = {
operation: 'deleteFile',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('test GoogleDriveV2: file move', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should be called with', async () => {
const nodeParameters = {
operation: 'move',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('test GoogleDriveV2: file share', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should be called with', async () => {
const nodeParameters = {
operation: 'share',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jest.mock('../../../../v2/transport', () => {
});

describe('test GoogleDriveV2: file update', () => {
afterAll(() => {
jest.unmock('../../../../v2/transport');
});

it('should be called with', async () => {
const nodeParameters = {
operation: 'update',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ describe('test GoogleDriveV2: file upload', () => {
jest.clearAllMocks();
});

afterAll(() => {
jest.unmock('../../../../v2/transport');
jest.unmock('../../../../v2/helpers/utils');
});

it('should upload buffers', async () => {
const nodeParameters = {
name: 'newFile.txt',
Expand Down
Loading
Loading