Skip to content

Commit

Permalink
allow blueprint's test to set custom packagePath
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarakaprasad committed Mar 12, 2024
1 parent a400a5c commit bdca7ae
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion testing/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,15 @@ class JHipsterRunContext extends RunContext<GeneratorTestType> {
/**
* Lookup generators at generator-jhipster's parent at a npm repository
* @param lookups generators relative folder
* @param packagePath overriden package path for the blueprint
* @returns
*/
withParentBlueprintLookup(lookups = ['generators']): this {
withParentBlueprintLookup(lookups = ['generators'], packagePath): this {
const packageRootParent = join(getPackageRoot(), '..');
if (basename(packageRootParent) === 'node_modules') {
this.withLookups([{ packagePaths: [join(packageRootParent, '..')], lookups }] as any);
} else if (packagePath) {
this.withLookups([{ packagePaths: [packagePath], lookups }] as any);
}
return this;
}
Expand Down

0 comments on commit bdca7ae

Please sign in to comment.