I have a Vue app I am trying to unit test, using jasmine/karma. Below is the code in a component:
After using v-for=(data,index) from database, I'm setting data.date in the template:
<p class="date">
{{ dateFilter(data.date) }}
</p>
Now I can test whether a given data is in the proper format. I currently have something like this in the spec file:
import { mount } from '@vue/test-utils';
import moment from 'moment'
it('should call method', () => {
const selector = wrapper.find('date');
});
How can I call the method and pass a mock parameter to test the method? Can we also import the moment js?