Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions examples/bun/api/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["oven.bun-vscode"]
}
2 changes: 1 addition & 1 deletion src/CommunityToolkit.Aspire.Hosting.Bun/BunAppResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ namespace Aspire.Hosting.ApplicationModel;
/// <param name="name">The name of the resource.</param>
/// <param name="workingDirectory">The working directory for the Bun app to launch from.</param>
public class BunAppResource(string name, string workingDirectory) :
ExecutableResource(name, "bun", workingDirectory);
ExecutableResource(name, "bun", workingDirectory), IResourceWithServiceDiscovery;
16 changes: 16 additions & 0 deletions tests/CommunityToolkit.Aspire.Hosting.Bun.Tests/AddBunAppTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,20 @@ public void BunAppWithPackageInstallationCreatesInstallerResource()
Assert.Equal("bun-bun-install", installerResource.Name);
Assert.Equal("bun", installerResource.Command);
}

[Fact]
public void BunAppResourceImplementsIResourceWithServiceDiscovery()
{
var builder = DistributedApplication.CreateBuilder();

builder.AddBunApp("bun");

using var app = builder.Build();

var appModel = app.Services.GetRequiredService<DistributedApplicationModel>();

var resource = Assert.Single(appModel.Resources.OfType<BunAppResource>());

Assert.IsAssignableFrom<IResourceWithServiceDiscovery>(resource);
}
}