result.replace(/(\[[^\[\]]+\])\(([^\)]+\.(html|md))\)/g, (match, p1, p2) => { if (/https?:\/\/.*$/.test(p2)) { return match; } let targetFile = path.join(path.dirname(absFilename), p2.replace(/\.(html|md)/, '')); const basename = path.posix.basename(targetFile); targetFile = path.join(path.dirname(targetFile), basename); let fileId = getFileId(rootPath, targetFile); if (fileId) { fileId = fileId.replace(/_readme/i, ''); return `${p1}(#${fileId})`; } return match; })
createJestConfig( filePath => path.posix.join('<rootDir>', filePath), null, true )
it("it should always use linux paths in docker code", async function() { const nodejs = require("../src/kinds/nodejs/nodejs") const path = require("path") // manually mock path path.sep = '\\' const posix = path.posix path.posix = { sep: '/' } process.chdir("test/nodejs/plain-onelevel"); const ret = nodejs.mountAction({ sourceFile: 'lib\\action.js', sourcePath: 'lib/action.js' }) // restore mock path.sep = '/' path.posix = posix // asserts assert(ret.code.includes('lib/action.js')) assert(!ret.code.includes('lib\\action.js')) });
createJestConfig( filePath => path.posix.join('<rootDir>', filePath), null, true )
createJestConfig( filePath => path.posix.join('<rootDir>', filePath), null, true )