20 lines
776 B
JavaScript
20 lines
776 B
JavaScript
//
|
|
// The @alias map must mirror _moduleAliases in package.json, which is what
|
|
// module-alias/register sets up at runtime.
|
|
//
|
|
// These were previously written as "../../server/..." relative paths, which
|
|
// jest resolves relative to the requiring file - so they never actually
|
|
// resolved, and every existing test sidestepped them with relative requires.
|
|
// <rootDir> is depth-independent and works from any test directory.
|
|
//
|
|
module.exports = {
|
|
moduleNameMapper: {
|
|
"^@root/(.*)$": "<rootDir>/$1",
|
|
"^@models/(.*)$": "<rootDir>/server/models/$1",
|
|
"^@routes/(.*)$": "<rootDir>/server/routes/$1",
|
|
"^@helpers/(.*)$": "<rootDir>/server/helpers/$1",
|
|
"^@config/(.*)$": "<rootDir>/server/config/$1",
|
|
"^@workers/(.*)$": "<rootDir>/server/workers/$1",
|
|
}
|
|
}
|