53 references to NpmInstallDetection
aspire (5)
Acquisition\InstallSourceDetector.cs (2)
60
if (
NpmInstallDetection
.IsNpmPackage(environment.GetEnvironmentVariable(
NpmInstallDetection
.PackageEnvironmentVariableName)))
Commands\UpdateCommand.cs (1)
132
return
NpmInstallDetection
.GetNpmUpdateCommand();
Interaction\ConsoleInteractionService.cs (1)
463
??
NpmInstallDetection
.GetNpmUpdateCommand()
Utils\CliUpdateNotifier.cs (1)
143
??
NpmInstallDetection
.GetNpmUpdateCommand()
Aspire.Cli.Tests (48)
Acquisition\InstallSourceDetectorTests.cs (7)
29
[
NpmInstallDetection
.PackageEnvironmentVariableName] =
NpmInstallDetection
.ExpectedPackageName
72
[
NpmInstallDetection
.PackageEnvironmentVariableName] =
NpmInstallDetection
.ExpectedPackageName
89
[
NpmInstallDetection
.PackageEnvironmentVariableName] = packageName
240
[
NpmInstallDetection
.PackageEnvironmentVariableName] =
NpmInstallDetection
.ExpectedPackageName
Commands\UpdateCommandTests.cs (6)
709
using var npmScope =
NpmInstallDetection
.UseEnvironmentForTesting(CreateNpmInstallEnvironment());
1189
using var npmScope =
NpmInstallDetection
.UseEnvironmentForTesting(CreateNpmInstallEnvironment());
3405
[
NpmInstallDetection
.PackageEnvironmentVariableName] =
NpmInstallDetection
.ExpectedPackageName,
3406
[
NpmInstallDetection
.PackageVersionEnvironmentVariableName] = "9.4.0",
3407
[
NpmInstallDetection
.PackageRidEnvironmentVariableName] = "linux-x64"
ProgramTests.cs (2)
46
[
NpmInstallDetection
.PackageEnvironmentVariableName] = source == "npm" ?
NpmInstallDetection
.ExpectedPackageName : null
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());