Skip to content

Commit d0b2de7

Browse files
committed
Add site name option and update test skip reason
- Introduced `nameFlag` in `Program.cs` to allow specifying a name when creating a new Blazor WASM site. - Updated the test in `BlakeNewCommandTests.cs` to include a skip reason for the method `BlakeNew_WithNoArguments_ShowsHelp`, highlighting the need for future testing considerations.
1 parent 5269c90 commit d0b2de7

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/Blake.CLI/Program.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,9 +336,12 @@ private static async Task<int> NewSiteAsync(string[] args, ILogger logger)
336336
{
337337
// don't use a template, just create a new Blazor site and initialise
338338
logger.LogInformation("No template specified, creating a new Blazor WASM site using the default template.");
339+
340+
var nameFlag = string.IsNullOrWhiteSpace(newSiteName)? string.Empty : $" --name \"{newSiteName}\"";
341+
339342
var process = new Process
340343
{
341-
StartInfo = new ProcessStartInfo("dotnet", $"new blazorwasm -o \"{directory}\"")
344+
StartInfo = new ProcessStartInfo("dotnet", $"new blazorwasm -o \"{directory}\"{nameFlag}")
342345
{
343346
RedirectStandardOutput = true,
344347
RedirectStandardError = true,

tests/Blake.IntegrationTests/Commands/BlakeNewCommandTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace Blake.IntegrationTests.Commands;
1111
/// </summary>
1212
public class BlakeNewCommandTests : TestFixtureBase
1313
{
14-
[Fact]
14+
[Fact(Skip ="Blake creates a site with no args. TODO: consider how to test this, it will run it in the assembly folder.")]
1515
public async Task BlakeNew_WithNoArguments_ShowsHelp()
1616
{
1717
// Act

0 commit comments

Comments
 (0)