I'm trying to mock my import with animations, but I keep getting
● Test suite failed to run
C:\work\portfolio\node_modules\gsap\TweenMax.js:13
import TweenLite, { TweenPlugin, Ease, Power0, Power1, Power2, Power3, Power4, Linear } from "./TweenLite.js";
^^^^^^^^^
SyntaxError: Unexpected identifier
The error is from one of the imports from my file.
App.js
const App = () => (
<ChronologyGraph
width="700"
height="800"
nodeSize={10}
milestones={milestones.reverse()}
columns={nodeTypes}
/>
);
export default App;
inside of ChronologyGraph I import my component ProjectNode which imports another file I made animation.js and inside of animation.js I import
import { TimelineMax, Power0 } from "gsap/TweenMax";
import { TweenMax } from "gsap/TweenMaxBase";
Which are causing the error above, I want to either mock this gsap library or just my animation.js
App.test.js
import React from "react";
import { shallow } from 'enzyme';
import App from "./App";
fit("renders without crashing", () => {
jest.mock('../animation.js');
jest.mock('gsap/TweenMaxBase');
jest.mock('gsap/TweenMax');
const wrapper = shallow(<App />);
});
And here are all the mocks I've tried without any success