I am working on unit testing a Vue app using `jasmine` and `karma`. Here is an example of the code inside one of my components:
After fetching data from a database with `v-for=(data,index)
`, I am displaying the `data.date` in the template:
<p class="date">
{{ dateFilter(data.date) }}
</p>
I want to test if the date is being properly formatted. In my spec file, I have something like this:
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 provide mock parameters for testing? Also, is it possible to import moment.js in our tests?