Коллеги, подскажите, перелазил уже все форумы - как избавиться от ошибки? юнит тесты работают, а с интеграционными проблемы
babel.config
module.exports = {
presets: [
[
'@babel/env',
{
modules: false,
targets: {
browsers: [
'IE >= 10',
'Chrome >= 54',
'Safari >= 9',
'Firefox >= 50',
'Opera >= 43',
'last 2 versions',
],
},
},
],
'@babel/react',
['@babel/preset-typescript'],
['@babel/preset-flow'],
],
plugins: [
'@babel/plugin-transform-flow-comments',
'lodash',
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-syntax-dynamic-import',
'@babel/plugin-proposal-export-namespace-from',
'@babel/plugin-proposal-optional-catch-binding',
[
'@babel/plugin-proposal-class-properties',
{
loose: true,
},
],
'@babel/plugin-proposal-decorators',
[
'@babel/plugin-proposal-object-rest-spread',
{
loose: true,
useBuiltIns: true,
},
],
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
],
};
tsconfig
{
"compilerOptions": {
"allowJs": true,
"target": "es6",
"jsx": "react",
"module": "esnext",
"moduleResolution": "node",
"baseUrl": "./",
"paths": {
"@/*": ["./src/*"]
},
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"preserveSymlinks": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noUnusedLocals": true,
"skipLibCheck": true,
"noImplicitAny": false
},
"ts-node": {
"compilerOptions": {
"module": "CommonJS"
}
}
}
jest config
module.exports = {
automock: false,
bail: false,
cache: false,
changedFilesWithAncestor: false,
clearMocks: true,
coveragePathIgnorePatterns: ['/node_modules/', '/dist/'],
coverageReporters: ['json', 'text', 'lcov', 'clover'],
coverageThreshold: {
global: {
branches: 60,
functions: 60,
lines: 60,
statements: 60,
},
},
expand: false,
globals: {},
moduleFileExtensions: ['js', 'json', 'jsx', 'node', 'ts', 'tsx'],
moduleNameMapper: {
'^@/(.*)$': '<rootDir>/src/$1',
'^.+\\.(css|scss)$': '@company/build-configs/jest/mocks/style.js',
'^.+\\.path$': '@company/build-configs/jest/mocks/path.js',
'^.+\\.pdf$': '@company/build-configs/jest/mocks/pdf.js',
'@company/services/style-names': '@company/build-configs/jest/mocks/style-names',
asn1js: '@company/build-configs/jest/mocks/asn1js.js',
pkijs: '@company/build-configs/jest/mocks/pkijs.js',
'@company/ui-lib-(.*)': '@company/ui-lib-$1/src',
'@company/bi-lib-(.*)': '@company/bi-lib-$1/src',
},
modulePaths: ['node_modules', '<rootDir>'],
noStackTrace: false,
notify: false,
notifyMode: 'always',
preset: 'ts-jest',
rootDir: './',
runner: 'jest-runner',
snapshotSerializers: [],
testEnvironment: 'jsdom',
testEnvironmentOptions: {},
testFailureExitCode: 1,
testLocationInResults: true,
testMatch: ['<rootDir>/**/*.test.ts', '<rootDir>/**/*.test.tsx'],
testPathIgnorePatterns: ['/node_modules/', '/dist/'],
testResultsProcessor: 'jest-sonar-reporter',
transform: {
'\\.jsx?$': 'babel-jest',
'\\.tsx?$': 'ts-jest',
'^.+\\.(scss)$': '<rootDir>/src/shared/lib/file-transform.js',
},
verbose: true,
};
path/наш сервис/node_modules/@company/some-ui-lib/src/index.ts:5
export {PortalsRoot, rootRef} from './lib/dom-portal';
^^^^^^
SyntaxError: Unexpected token 'export'
> 1 | import { PortalsRoot } from '@company/some-ui-lib';
| ^
2 | import { uniqueId } from 'lodash';
3 | import React, {
4 | Fragment,