1 | // Copied from https://github.com/facebook/jest/blob/master/packages/jest-config/src/utils.js
|
2 | // in order to reduce incompatible jest dependencies
|
3 |
|
4 | const path = require('path');
|
5 |
|
6 | module.exports = {
|
7 | replaceRootDirInPath : (rootDir,filePath) => {
|
8 | if (!/^<rootDir>/.test(filePath)) {
|
9 | return filePath;
|
10 | }
|
11 |
|
12 | return path.resolve(
|
13 | rootDir,
|
14 | path.normalize('./' + filePath.substr('<rootDir>'.length))
|
15 | )
|
16 | }
|
17 | }
|