test axios in a Vue project

This issue has been tracked since 2018-01-04.

There are some code,

    let msg 
    it ('should send off a request when clicked', (done) => {
        moxios.stubRequest( URL, {
            status: 200,
            response: []
        })

       axios.get(URL).then(res => {
          console.log(res)
          msg = res
       })

        moxios.wait(() => {
            expect(msg.status).toEqual(200)
            done()
        })
    })

When I test it, I found out,two URL as long as it is the same, the test will be successful.
It does not get the interface from the server side.
What I want to know is how to get the interface through the server?

anilanar wrote this answer on 2018-05-27

Kamino cloned this issue to anilanar/moxios

More Details About Repo
Owner Name axios
Repo Name moxios
Full Name axios/moxios
Language JavaScript
Created Date 2016-05-25
Updated Date 2022-12-05
Star Count 1386
Watcher Count 20
Fork Count 85
Issue Count 19

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date