Currently utilizing NestJs with Nx.dev for a monorepo setup. However, I've come across an issue after installing csv-parse/sync - my Jest tests are now failing to work.
Jest encountered an unexpected token
Jest failed to parse a file due to non-standard JavaScript syntax being used in your code or its dependencies, or possibly a lack of configuration support in Jest.
By default, Jest supports Babel for transforming files into valid JS based on your Babel settings.
The "node_modules" folder is typically excluded from transformation by default.
Here are some possible solutions:
• If using ECMAScript Modules, refer to https://jestjs.io/docs/ecmascript-modules to enable it.
• For TypeScript usage, consult https://jestjs.io/docs/getting-started#using-typescript
• To transform certain "node_modules" files, specify a custom "transformIgnorePatterns" in your configuration.
• If a custom transformation is needed, define a "transform" option in your config.
• When wanting to mock non-JS modules (e.g. binary assets), utilize the "moduleNameMapper" config option.
Details:
/home/username/project/node_modules/csv-parse/lib/sync.js:2
import { Parser } from './index.js';
I attempted to follow the provided links without success. Has anyone else encountered this same issue?