title: Jest test on functions which are in onMounted Composition API Vue 2
body: <p>Can anyone tell me how to write a test case for the functions which are in <code>onMounted</code> hook? I am using vue 2 with composition api plugin.</p>
  <pre><code>    const getUsers = async () =&gt; {
              const usersQuery = `
                  query {
                    users: {
                       id
                       username
                     }
                  }
              `
              try {
                  const result = await apolloClient.getGraphqlData(usersQuery)
                  if (result) users.value = result.data.users
              } catch (err) {
                  console.log('Error while receiving users', err)
              }
          }
  </code></pre>
  <p>Below is my <code>onMounted</code> hook</p>
  <pre><code>onMounted(() =&gt; {
      getUsers()
  })
  </code></pre>