I am using the enzyme for testing my react app.
Now inside my app when I am running following command I am getting below output
Inside jsx file when I do console.log for below-mentioned line
Input - new Date(moment().format('YYYY,MM,DD'))
Output - Wed Aug 30 2017 00:00:00 GMT+0530 (IST)
But inside test cases when I am passing value defautlState
const defaultState = {
dateToDisplay: new Date(moment().format('YYYY,MM,DD')),
};
it('shows slots on time scroller', () =>{
const wrapper = shallow(<BookingDialogNew />);
wrapper.setProps(defaultProps);
wrapper.setState(defaultState);
});
I am getting output - 2017-08-29T18:30:00.000Z
Not very good with moment and date, how to get output same as in the jsx file Are there two line are same, please guide