-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Description
Current behavior
Date object is converted to a String when it's an argument in cy.task.
Cypress config file (task definition):
date(date) {
const date_2 = new Date();
console.log(date);
console.log(date_2);
console.log(Object.prototype.toString.call(date));
console.log(Object.prototype.toString.call(date_2));
},spec file:
it.('should pass a Date arg in cy.task', function () {
const date = new Date()
cy.log(Object.prototype.toString.call(date))
cy.task('date', date)
});The cypress cy.log command is printing:
The terminal log is printing:
The type of the date argument was changed as we can see.
Desired behavior
Type of the argument should not be changed.
Test code to reproduce
Refer to current behavior section.
Cypress Version
15.4.0
Debug Logs
Other
No response
Metadata
Metadata
Assignees
Labels
No labels