How does vue use jest to test events?

how can I get this event?

helloworld
export default {
  name: "HelloWorld",
  data () {
    return {
      msg: "Welcome to Your Vue.js App"
    }
  },
  methods: {
    num () {
      return a + b
    }
  }
}

import HelloWorld from "@/components/HelloWorld"
test("adds 1 + 2 to equal 3", () => {
  // console.log(, "cc")
  // expect(vm.$options.methods.sum(1, 2)).toBe(3);
});
Jul.25,2021

you need to mount it first, and then call the function directly. Go directly to the vue-test-utils official website to see the test case

.
Menu