I have created one NPM library by using typescript react starter. In tsconfig file i given module as 'esnext' when i build and import it in another project it throwing error while doing npm run test. but it works fine in run and build time.
if put module as 'commonjs' it works fine for me. but i am not able to import images (import logo from './logo.ppng')
Please let me know how to run test cases by setuping module as 'esnext';
console log:
E:\frontend\-ui-component\src\setupTests.ts:7
import * as enzyme from 'enzyme';
^^^^^^
SyntaxError: Unexpected token import
at ScriptTransformer._transformAndBuildScript (node_modules/jest-runtime/build/ScriptTransformer.js:289:17)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
Test Suites: 2 failed, 2 total
Tests: 0 total
Snapshots: 0 total
Time: 1.907s, estimated 2s
Ran all test suites.
I have created one NPM library by using typescript react starter. In tsconfig file i given module as 'esnext' when i build and import it in another project it throwing error while doing npm run test. but it works fine in run and build time.
if put module as 'commonjs' it works fine for me. but i am not able to import images (import logo from './logo.ppng')
Please let me know how to run test cases by setuping module as 'esnext';
console log:
tsconfig of lcomponent (npm pack):
tsconfig of project (where i imported project):