Skip to content

Commit

Permalink
chore: fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Apr 26, 2021
1 parent 25a8431 commit 80b9779
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/core/src/generators/app/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ describe('nx-dotnet app generator', () => {
name: 'test',
language: 'C#',
template: 'mvc',
"test-template": 'none'
"test-template": 'none',
skipOutputPathManipulation: true
};

beforeEach(() => {
Expand Down
5 changes: 5 additions & 0 deletions packages/core/src/generators/app/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
{"value": "none", "label": "No Unit Test Project"}
]
}
},
"skipOutputPathManipulation": {
"type": "boolean",
"description": "Skip XML changes for default build path",
"default": "false"
}
},
"required": ["name", "template", "language"]
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/generators/lib/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ describe('nx-dotnet library generator', () => {
name: 'test',
language: 'C#',
template: 'classlib',
"test-template": 'none'
"test-template": 'none',
skipOutputPathManipulation: true
};

beforeEach(() => {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/generators/utils/generate-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async function GenerateTestProject(

dotnetClient.new(schema['test-template'], newParams);

if (!isDryRun()) {
if (!isDryRun() && !schema.skipOutputPathManipulation) {
const testCsProj = await findProjectFileInPath(testRoot);
SetOutputPath(host, testProjectName, testCsProj);
const baseCsProj = await findProjectFileInPath(schema.projectRoot);
Expand Down Expand Up @@ -228,7 +228,7 @@ export async function GenerateProject(
dotnetClient,
projectType
);
} else {
} else if (!options.skipOutputPathManipulation) {
SetOutputPath(
host,
normalizedOptions.projectName,
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/models/project-generator-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ export interface NxDotnetProjectGeneratorSchema {
template: string;
language: string;
"test-template": 'nunit' | 'mstest' | 'xunit' | 'none';
skipOutputPathManipulation: boolean;
}

0 comments on commit 80b9779

Please sign in to comment.