Hello,
I have try to migrate project from gsap2 to gsap3.
I faced with issue while run jest tests.
`index.ts
import { TimelineLite } from "gsap";
const timeline = new TimelineLite();
timeline.paused(true);
export const init = (fn: () => void) => {
timeline.call(fn, ['123'], "label");
timeline.play();
}
`
`
index.spec.ts
import { init } from './index';
describe('When multiplying numbers', () => {
it('Should call', () => {
const mock = jest.fn();
init(mock);
setTimeout(() => expect(mock).toHaveBeenCalledWith('123'), 50);
});
});
`
This test is passing for gsap2 and don't passing for gsap3.
When i remove `
timeline.paused(true);
then it starts passing for gsap3.
Why?
Attached full code.
typescript-jest-boilerplate.zip