test(Date & Time Node): Unit tests (no-changelog) (#5415)

*  Add tests to DateTime node

* Test different timezone

* Try new fix

* Fix workflow change time of workflow exec in UTC

* Check if UTC is correctly setup

---------

Co-authored-by: Marcus <marcus@n8n.io>
This commit is contained in:
agobrech
2023-02-09 14:54:24 +01:00
committed by GitHub
parent 3e2d76ec79
commit 40f4ec75fa
2 changed files with 345 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import { testWorkflows, getWorkflowFilenames } from '../../../../test/nodes/Helpers';
const workflows = getWorkflowFilenames(__dirname);
// ! When making changes to the Workflow test files make sure to export env TZ=UTC as Github Actions runs in UTC timezone
if (new Date().getTimezoneOffset() === 0) {
describe('Test DateTime Node', () => testWorkflows(workflows));
} else {
describe('Test DateTime Node', () => {
it('Skipped because timezone is not UTC', () => {
expect(true).toBe(true);
});
});
}