Last active
November 17, 2023 03:15
-
-
Save alfonsomunozpomer/2bcbbb89bcdb8e5b8ed7070654779d99 to your computer and use it in GitHub Desktop.
A Highcharts mock for Jest (place it in yout __mocks__ directory) to test components that depend on React Highcharts
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
const highcharts = jest.genMockFromModule(`highcharts`) | |
// So that Boost and Exporting modules don’t complain when running tests | |
highcharts.getOptions = () => ({ plotOptions: {} }) | |
module.exports = highcharts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here are some adjustments:
genMockFromModule
has been deprecated, for instance