[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
Current behavior
When running our tests with jest we receive the error SyntaxError: Cannot use import statement outside a module
C:\path-to-project\node_modules\ngx-permissions\fesm2015\ngx-permissions.mjs:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import * as i0 from '@angular/core';
^^^^^^
SyntaxError: Cannot use import statement outside a module
Expected behavior
The import should just work as is.
Basically just create a new angular project with the given version below, add jest and jest-preset-angular. Additionally add and import the NgxPermissionsModule and run the tests.
To be perfectly honest I am not sure if this is a concern you can address or if it is something we need to change on our side.
I tried adjusting the jest.config by adding mjs into moduleFileExtensions along with node_modules/(?!ngx-permissions) to transformIgnorePatterns definition.
I'm submitting a...
Current behavior
When running our tests with jest we receive the error
SyntaxError: Cannot use import statement outside a module
Expected behavior
The import should just work as is.
Basically just create a new angular project with the given version below, add jest and jest-preset-angular. Additionally add and import the NgxPermissionsModule and run the tests.
Environment
To be perfectly honest I am not sure if this is a concern you can address or if it is something we need to change on our side. I tried adjusting the jest.config by adding
mjs
intomoduleFileExtensions
along withnode_modules/(?!ngx-permissions)
totransformIgnorePatterns
definition.