What is the basic idea of vue unit testing?

preliminary writing, it feels like a detour, (in the unit test you want to pass the external api of vuex"s action and then verify it).
I have a few questions:
1. Unit tests do not require external api. As long as the data can run on mock?
2. (in the unit test, access the external api through vuex"s action to get the results and verify the tobe not tobe.) does this approach go too far?

Apr.25,2022

  1. Yes, you need to specify the scope you are testing, as long as you ensure that the component behaves as expected under the correct or expected exception data
  2. api should not be needed by cover for front-end unit tests. For reasons, see 1 import js API should write interface tests separately at the back end. If there is complex logic in vuex, you can test the corresponding methods in a separate import js file without the process of testing data from vuex to components, which is meaningless
  3. .
Menu