jest test async code
### Notes
- Add `async` to the function that gets passed to the test - Use `await` when calling the function under test - Make the function under test `async` - Add `await` as necessary in the function under test
### Test file
Code
const sum =
### File under test
Code
// do some 'await' stuff here
return a + b
}
module.exports = sum