Created
May 19, 2019 21:27
-
-
Save achhunna/bf00871421eade1b55ffc1e6af828c7b to your computer and use it in GitHub Desktop.
Mocking modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// used in component | |
<script> | |
import Constants from '../constants'; | |
console.log(Constants.myConstant); | |
</script> | |
// in test file | |
jest.mock('../constants', () => ({ | |
'myConstant': 'myValue', | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment