Has anyone been able to pass Dates as params to methods while testing in Cypress ?
We currently have a Cypress command that looks like this:
Cypress.Commands.add("callMethod", (method, ...params) => {
Cypress.log({
name: "Calling method",
consoleProps: () => ({name: method, params})
});
cy.getMeteor().then(
Meteor =>
new Cypress.Promise((resolve, reject) => {
Meteor.call(method, ...params, (err, result) => {
if (err) {
reject(err);
}
resolve(result);
});
})
);
});
But when we use this to pass Dates as parameters we only receive an empty object on the server side. My guess is that it’s somehow related to EJSON which handles the serialisation of Dates. I’ve stepped through as far as I can on the client side and the Date is still a Date when talking to Meteor, but somehow it arrives an Object.
Anyone else encouter this ?