See Official doc vue-test-util-wrapper See digitalocean
- Test component exist - sanitize
- Test HTML contain some specific text
- Test set data
- Test prop
- Test button click - message success
- Test button click - message error
- Test class exist
This component show the utilisation of test helpers function See Official doc vue-test-util-wrapper See this helpers function github dekadentno Some examples
- hasAttribute
- find
- isHidden
- domHasLength
Test two exported function into utilities files, with jest snapshot
- read jest snapshot documentation, seem to be very interesting to compare (html, data, whole component, whole page) with cached result
- finish to read and understand this github repo
- get on eye on github repo
- regarder la video grafikart
- lire la 3 parties de https://reno184-wiki.blogspot.com/2021/10/vuemastery-real-word-testing.html?zx=8721610398e46d69 la porte mock vuex
- voir https://www.npmjs.com/package/jest-fetch-mock
- https://benjaminjohnson.me/mocking-fetch
- https://medium.com/fernandodof/how-to-mock-fetch-calls-with-jest-a666ae1e7752
- https://github.com/sapegin/jest-cheat-sheet#mock-functions-1
- https://webdevetc.com/blog/vue-test-utils-advanced-features?__s=xxxxxxx
- https://github.com/dekadentno/vue-unit-testing-cheat-sheet
npm run serve
npm run build
npm run test:unit
npm run lint