refactor: Overhaul nodes-testing setup - Part 3 (no-changelog) (#14967)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-04-29 17:42:21 +02:00
committed by GitHub
parent 3e43f9f8bc
commit 979f9e6327
241 changed files with 1868 additions and 2013 deletions

View File

@@ -1,10 +1,9 @@
/* eslint-disable n8n-nodes-base/node-param-display-name-miscased */
import { NodeTestHarness } from '@nodes-testing/node-test-harness';
import { mock, mockDeep } from 'jest-mock-extended';
import { jsonParse, type ILoadOptionsFunctions, type INode } from 'n8n-workflow';
import nock from 'nock';
import { testWorkflows } from '@test/nodes/Helpers';
import { getGmailAliases, getLabels, getThreadMessages } from '../../v2/loadOptions';
import labels from '../fixtures/labels.json';
import messages from '../fixtures/messages.json';
@@ -131,7 +130,9 @@ describe('Test Gmail Node v2', () => {
afterAll(() => gmailNock.done());
testWorkflows(['nodes/Google/Gmail/test/v2/messages.workflow.json']);
new NodeTestHarness().setupTests({
workflowFiles: ['messages.workflow.json'],
});
});
describe('Labels', () => {
@@ -154,7 +155,9 @@ describe('Test Gmail Node v2', () => {
afterAll(() => gmailNock.done());
testWorkflows(['nodes/Google/Gmail/test/v2/labels.workflow.json']);
new NodeTestHarness().setupTests({
workflowFiles: ['labels.workflow.json'],
});
});
describe('Drafts', () => {
@@ -242,7 +245,9 @@ describe('Test Gmail Node v2', () => {
afterAll(() => gmailNock.done());
testWorkflows(['nodes/Google/Gmail/test/v2/drafts.workflow.json']);
new NodeTestHarness().setupTests({
workflowFiles: ['drafts.workflow.json'],
});
});
describe('Threads', () => {
@@ -303,7 +308,9 @@ describe('Test Gmail Node v2', () => {
afterAll(() => gmailNock.done());
testWorkflows(['nodes/Google/Gmail/test/v2/threads.workflow.json']);
new NodeTestHarness().setupTests({
workflowFiles: ['threads.workflow.json'],
});
});
describe('loadOptions', () => {