I am using jest with the Vue framework, to write unite tests. My example test is passing but I am having an error logging the request. How do I fix this issue? Am I using async incorrectly in jest? A copy of the test is below with the error farther down below.
Test
describe('Home', () => {
test('Example Test', async () => {
// Arrange - Mounts the component so we can test it. And chooses what we are going to test in the component
const wrapper = mount(Home2)
// Act - Does something to the component
// Assert - Checks to see if what we did to the component matches what we want it to do
expect(wrapper.html()).toContain(0)
})
})
Error with test passing
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 1.324 s
Ran all test suites.
● Cannot log after tests are done. Did you forget to wait for something async in your test?
Attempted to log "Get Error: Error: Network Error
at createError (/home/user/Documents/Code/RRMEC/src/frontend/node_modules/axios/lib/core/createError.js:16:15)
at XMLHttpRequest.handleError (/home/user/Documents/Code/RRMEC/src/frontend/node_modules/axios/lib/adapters/xhr.js:84:14)