You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a fresh minimal angular workspace of current version I can't use a third party package which is built of ES modules and run tests with Jest.
> nx run main:test
FAIL main apps/main/src/app/app.component.spec.ts
● Test suite failed to run
Jest encountered an unexpected token
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
...
SyntaxError: Cannot use import statement outside a module
1 | import { Component, OnInit, ViewEncapsulation } from '@angular/core';
2 |
> 3 | import WebMap from '@arcgis/core/WebMap';
| ^
Expected Behavior
Because Jest is an important part of nx setup and more and more third party packages are built of ES modules we need support of such packages.
Current Behavior
In a fresh minimal angular workspace of current version I can't use a third party package which is built of ES modules and run tests with Jest.
Expected Behavior
Because Jest is an important part of nx setup and more and more third party packages are built of ES modules we need support of such packages.
Steps to Reproduce
Although this problem has been discussed and documented a lot, I creates a repo again with our necessary dependency as an example.
https://github.com/GeofoxCoding/nx-esm-jest
run
npm install
nx test main
Is there any current solution how to get our dependency @arcgis/core working in Nx Jest setup?
The text was updated successfully, but these errors were encountered: