'How to test socket io from vue jest?
this is my code from vue.js:
async getUserInformation(user_id){
return await new Promise((resolve, reject) => {
this.$socket.client.emit('getUserInfo', user_id, (err,res) => {
err ? reject(err) : resolve(res)
})
})
},
async selectAction() {
let getReponse= await this.getUserInformation(this.user_id)
this.userInformation = getResponse
}
this is my code from vue jest
describe('editUser.vue', () => {
let wrapper
beforeEach(() => {
wrapper = shallowMount(editUser, {
mixins: [global]
})
});
it('trigger submit button w/o data input from text fields', async () => {
await wrapper.find('[data-testid="get_user_button"]').trigger('click')
});
});
Picture below is the error message I received after I run unit testing

Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
