'Jest failed to parse a file

I am using react with typescript, and I just added a new dependency called react-photoswipe-gallery, and after that my tests are broken, and I get the following error

enter image description here

my jest.config.js is :

module.exports = {
collectCoverage: false,
globals: {
    window: {},
},

moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
roots: ['<rootDir>/src'],
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
snapshotSerializers: ['enzyme-to-json/serializer'],
testEnvironment: 'jsdom',
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$',
transform: {
    '^.+\\.tsx?$': 'ts-jest',
 },
};


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source