When executing npm run test
, which triggers the execution of jest
, a test suite fails with the following error message:
/home/anthony/nosync/development/openmeteo/enhydris-web-frontend/node_modules/vue-notifications/dist/vue-notifications.js:130
export default VueNotifications;
SyntaxError: Unexpected token 'export'
The relevant configuration in jest.config.js
is as follows:
transform: {
'^.+\\.js$': 'babel-jest',
'.*\\.(vue)$': 'vue-jest',
},
transformIgnorePatterns: ['node_modules/(?!(vue-notifications)/)'],
I have also been using npm run test -- --clearCache
regularly for reassurance. However, it appears that the transformIgnorePatterns
does not have any effect.
The error message ends with :130
. Is this number indicative of the line where the error occurs? Surprisingly, the problematic line export default VueNotifications
is actually on line 117. Even when adding empty lines to move it down, the error still references :130
. (Commenting out the line resolves the issue, but the tests fail as the export statement is necessary.)