Skip to content

Breaking changes: pathsToModuleNameMapper resolve path mapping with path.join #1982

@splincode

Description

@splincode

🐛 Bug Report

@ahnpnl Hi, I see this PR
#1969

But this incorrect work when we usage parent directory
After upgrade my test failed
Angular-RU/sdk#172

To Reproduce

we usage ../ in paths

{
    "compilerOptions": {
        "rootDir": ".",
        "baseUrl": "./",
        "module": "esnext",
        "outDir": "./dist/out-tsc",
        "target": "es5",
        "typeRoots": ["../../node_modules/@types", "./"],
        "lib": ["es2018", "dom"],
        "paths": {
            "@angular-ru/logger": ["dist/library"],
            "@angular-ru/common": ["../common/dist/library"],
            "@angular-ru/common/*": ["../common/dist/library/*"]
        }
    }
}

My test for correct behavior work with pathsToModuleNameMapper (ts-jest < 26.4.0):
https://github.com/Angular-RU/angular-ru-sdk/blob/master/packages/jest-utils/integration/tests/simple.spec.ts#L36

Expected behavior

https://github.com/kulshekhar/ts-jest/pull/1969/files#diff-0896c7082173d4fb5357a023b5205b17R10

could you add another test?

https://github.com/Angular-RU/angular-ru-sdk/blob/master/packages/jest-utils/tsconfig.json#L14
where are you referring to the parent directory?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions