Skip to content

Commit

Permalink
docs(devs-infra): fixed broken guide for paths mapping helper (#3894)
Browse files Browse the repository at this point in the history
  • Loading branch information
seongbin9786 committed Nov 7, 2022
1 parent 0e3e733 commit f45cc08
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions website/docs/getting-started/paths-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ const { compilerOptions } = require('./tsconfig')
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
// [...]
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl], // <-- This will be set to 'baseUrl' value
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */),
}
```
Expand All @@ -89,6 +91,8 @@ import type { JestConfigWithTsJest } from 'ts-jest'

const jestConfig: JestConfigWithTsJest = {
// [...]
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl], // <-- This will be set to 'baseUrl' value
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */),
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const { compilerOptions } = require('./tsconfig')

module.exports = {
// [...]
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl], // <-- This will be set to 'baseUrl' value
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */),
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const { compilerOptions } = require('./tsconfig')

module.exports = {
// [...]
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl], // <-- This will be set to 'baseUrl' value
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */),
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const { compilerOptions } = require('./tsconfig')

module.exports = {
// [...]
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl], // <-- This will be set to 'baseUrl' value
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */),
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ const { compilerOptions } = require('./tsconfig')

module.exports = {
// [...]
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl], // <-- This will be set to 'baseUrl' value
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */),
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ const { compilerOptions } = require('./tsconfig')
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
// [...]
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl], // <-- This will be set to 'baseUrl' value
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */),
}
```
Expand All @@ -89,6 +91,8 @@ import type { JestConfigWithTsJest } from 'ts-jest'

const jestConfig: JestConfigWithTsJest = {
// [...]
roots: ['<rootDir>'],
modulePaths: [compilerOptions.baseUrl], // <-- This will be set to 'baseUrl' value
moduleNameMapper: pathsToModuleNameMapper(compilerOptions.paths /*, { prefix: '<rootDir>/' } */),
}

Expand Down

0 comments on commit f45cc08

Please sign in to comment.