42 references to NpmInstallDetection
aspire (3)
Commands\UpdateCommand.cs (1)
129
return
NpmInstallDetection
.GetNpmUpdateCommand();
Interaction\ConsoleInteractionService.cs (1)
463
??
NpmInstallDetection
.GetNpmUpdateCommand()
Utils\CliUpdateNotifier.cs (1)
143
??
NpmInstallDetection
.GetNpmUpdateCommand()
Aspire.Cli.Tests (39)
Commands\UpdateCommandTests.cs (6)
705
using var npmScope =
NpmInstallDetection
.UseEnvironmentForTesting(CreateNpmInstallEnvironment());
1185
using var npmScope =
NpmInstallDetection
.UseEnvironmentForTesting(CreateNpmInstallEnvironment());
3400
[
NpmInstallDetection
.PackageEnvironmentVariableName] =
NpmInstallDetection
.ExpectedPackageName,
3401
[
NpmInstallDetection
.PackageVersionEnvironmentVariableName] = "9.4.0",
3402
[
NpmInstallDetection
.PackageRidEnvironmentVariableName] = "linux-x64"
Utils\CliUpdateNotificationServiceTests.cs (5)
293
using var npmScope =
NpmInstallDetection
.UseEnvironmentForTesting(CreateNpmInstallEnvironment());
439
[
NpmInstallDetection
.PackageEnvironmentVariableName] =
NpmInstallDetection
.ExpectedPackageName,
440
[
NpmInstallDetection
.PackageVersionEnvironmentVariableName] = "9.4.0",
441
[
NpmInstallDetection
.PackageRidEnvironmentVariableName] = "linux-x64"
Utils\NpmInstallDetectionTests.cs (28)
13
using var scope =
NpmInstallDetection
.UseEnvironmentForTesting(new Dictionary<string, string?>
15
[
NpmInstallDetection
.PackageEnvironmentVariableName] =
NpmInstallDetection
.ExpectedPackageName,
16
[
NpmInstallDetection
.PackageVersionEnvironmentVariableName] = "9.4.0",
17
[
NpmInstallDetection
.PackageRidEnvironmentVariableName] = "linux-x64",
20
Assert.True(
NpmInstallDetection
.IsRunningFromNpm());
22
$"npm install -g {
NpmInstallDetection
.ExpectedPackageName}@latest",
23
NpmInstallDetection
.GetNpmUpdateCommand());
24
Assert.Equal("9.4.0",
NpmInstallDetection
.GetNpmPackageVersion());
25
Assert.Equal("linux-x64",
NpmInstallDetection
.GetNpmPackageRid());
37
using var scope =
NpmInstallDetection
.UseEnvironmentForTesting(new Dictionary<string, string?>
39
[
NpmInstallDetection
.PackageEnvironmentVariableName] = packageName,
40
[
NpmInstallDetection
.PackageVersionEnvironmentVariableName] = "9.4.0",
41
[
NpmInstallDetection
.PackageRidEnvironmentVariableName] = "linux-x64",
44
Assert.False(
NpmInstallDetection
.IsRunningFromNpm());
45
Assert.Null(
NpmInstallDetection
.GetNpmUpdateCommand());
51
using var scope =
NpmInstallDetection
.UseEnvironmentForTesting(new Dictionary<string, string?>
53
[
NpmInstallDetection
.PackageEnvironmentVariableName] =
NpmInstallDetection
.ExpectedPackageName,
56
Assert.Null(
NpmInstallDetection
.GetNpmPackageVersion());
57
Assert.Null(
NpmInstallDetection
.GetNpmPackageRid());
65
using var baseline =
NpmInstallDetection
.UseEnvironmentForTesting(new Dictionary<string, string?>());
66
Assert.False(
NpmInstallDetection
.IsRunningFromNpm());
68
using (
NpmInstallDetection
.UseEnvironmentForTesting(new Dictionary<string, string?>
70
[
NpmInstallDetection
.PackageEnvironmentVariableName] =
NpmInstallDetection
.ExpectedPackageName,
73
Assert.True(
NpmInstallDetection
.IsRunningFromNpm());
76
Assert.False(
NpmInstallDetection
.IsRunningFromNpm());