Skip to content

Commit 81d08ad

Browse files
fix(Wait Node): Fix wait node tests by always using a future date (#14733)
1 parent fec2284 commit 81d08ad

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

packages/nodes-base/nodes/Wait/test/Wait.node.test.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const workflows = getWorkflowFilenames(__dirname);
1111
describe('Execute Wait Node', () => {
1212
let timer: NodeJS.Timer;
1313
const { clearInterval, setInterval } = global;
14+
const nextDay = DateTime.now().startOf('day').plus({ days: 1 });
1415

1516
beforeAll(() => {
1617
timer = setInterval(() => jest.advanceTimersByTime(1000), 10);
@@ -25,24 +26,24 @@ describe('Execute Wait Node', () => {
2526
test.each([
2627
{ value: 'invalid_date', isValid: false },
2728
{
28-
value: '2025-04-18T10:50:47.560',
29+
value: nextDay.toISO(),
2930
isValid: true,
30-
expectedWaitTill: new Date('2025-04-18T10:50:47.560Z'),
31+
expectedWaitTill: nextDay.toJSDate(),
3132
},
3233
{
33-
value: '2025-04-18T10:50:47.560+02:00',
34+
value: nextDay.toISO({ includeOffset: true }),
3435
isValid: true,
35-
expectedWaitTill: new Date('2025-04-18T08:50:47.560Z'),
36+
expectedWaitTill: nextDay.toUTC().toJSDate(),
3637
},
3738
{
38-
value: DateTime.fromISO('2025-04-18T10:50:47.560Z').toJSDate(),
39+
value: nextDay.toJSDate(),
3940
isValid: true,
40-
expectedWaitTill: new Date('2025-04-18T10:50:47.560Z'),
41+
expectedWaitTill: nextDay.toJSDate(),
4142
},
4243
{
43-
value: DateTime.fromISO('2025-04-18T10:50:47.560Z'),
44+
value: nextDay,
4445
isValid: true,
45-
expectedWaitTill: new Date('2025-04-18T10:50:47.560Z'),
46+
expectedWaitTill: nextDay.toJSDate(),
4647
},
4748
])(
4849
'Test Wait Node with specificTime $value and isValid $isValid',

0 commit comments

Comments
 (0)