Skip to content

Test cases failing: ReferenceError: AmCharts is not defined #88

Description

@vikramgupta1988

While running testcases using Jest and Enzyme. I get an error like below.

ReferenceError: AmCharts is not defined at node_modules/@amcharts/amcharts3-react/amcharts3-react.js:253:3 at Object.<anonymous> (node_modules/@amcharts/amcharts3-react/amcharts3-react.js:298:3) at Object.<anonymous> (node_modules/@amcharts/amcharts3-react/index.js:6:3)

The AmCharts are imported in my project like below
import AmCharts from '@amcharts/amcharts3-react'

I found a solution that is to be added to amcharts-react plugin at line 252.
var AmCharts = AmCharts || {};
This is solving the issue. Can I create a PR for this?

Or alternatively can we ignore the import while running the test case?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions