File tree Expand file tree Collapse file tree
heft-plugins/heft-jest-plugin/src/transformers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ const isWindows: boolean = process.platform === 'win32';
1313 */
1414export class StringMockTransformer implements SyncTransformer {
1515 public process ( sourceText : string , sourcePath : string , options : TransformOptions ) : TransformedSource {
16- const relativePath : string = relative ( options . config . cwd , sourcePath ) ;
16+ // heft-jest-plugin enforces that config.rootDir will always be the project root folder.
17+ const relativePath : string = relative ( options . config . rootDir , sourcePath ) ;
1718 const normalizedRelativePath : string = isWindows ? relativePath . replace ( / \\ / g, '/' ) : relativePath ;
1819 // For a file called "myImage.png", this will generate a JS module that exports the slash-normalized relative
1920 // path from the current working directory to "myImage.png"
You can’t perform that action at this time.
0 commit comments