UNPKG

@highflying/jest-module-name-mapper

Version:

Synchronization tsconfig paths with Jest (module name mapper)

8 lines (6 loc) 280 B
export const tsconfigRootPrefix = './'; export const jestRootPrefix = '<rootDir>/'; export const baseUrlFactory = (baseUrl: string): string => baseUrl.startsWith(tsconfigRootPrefix) ? baseUrl.replace(tsconfigRootPrefix, jestRootPrefix) : `${jestRootPrefix}${baseUrl}`;