Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update embedded JS/TS analyzer 10.11.0.25043 #5177

Merged
merged 1 commit into from
Jan 16, 2024
Merged
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
2 changes: 1 addition & 1 deletion src/EmbeddedSonarAnalyzer.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<!-- Note: Guide on how to update the analyzers is on the xtranet! -->
<EmbeddedSonarAnalyzerVersion>9.16.0.82469</EmbeddedSonarAnalyzerVersion>
<EmbeddedSonarCFamilyAnalyzerVersion>6.52.0.66181</EmbeddedSonarCFamilyAnalyzerVersion>
<EmbeddedSonarJSAnalyzerVersion>10.10.0.24774</EmbeddedSonarJSAnalyzerVersion>
<EmbeddedSonarJSAnalyzerVersion>10.11.0.25043</EmbeddedSonarJSAnalyzerVersion>
<!-- Secrets
Secrets are special case: we get the analyzer binaries from a NuGet package, and the
rule help from an "normal" Java plugin. The two artefacts are versioned separately.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ public void Locate_NoCompatibleVersions_ReturnsNull()
var versions = new List<NodeVersionInfo>
{
new("bad version", new Version(9, 0)),
new("bad version", new Version(11, 0))
new("bad version", new Version(11, 0)),
new("bad version", new Version(14, 16)),
new("bad version", new Version(14, 17)),
new("bad version", new Version(14, 18)),
new("bad version", new Version(15, 9))
};

var testSubject = CreateTestSubject(versions);
Expand All @@ -70,19 +74,22 @@ public void Locate_NoCompatibleVersions_ReturnsNull()
[TestMethod]
public void Locate_ReturnsFirstCompatiblePath()
{
var firstCompatibleVersion = new NodeVersionInfo("compatible version1", new Version(16, 0));
var versions = new List<NodeVersionInfo>
{
new("bad version", new Version(11, 0)),
new("bad version2", new Version(14, 16)),
new("compatible2", new Version(14, 17)),
new("compatible3", new Version(14, 18)),
new("compatible4", new Version(15, 0)),
new("bad version3", new Version(14, 17)),
new("bad version4", new Version(14, 18)),
new("bad version5", new Version(15, 0)),
firstCompatibleVersion,
new("compatible version2", new Version(17, 1)),
};

var testSubject = CreateTestSubject(versions);

var result = testSubject.Locate();
result.Should().Be(versions[2]);
result.Should().Be(firstCompatibleVersion);
}

[TestMethod]
Expand All @@ -106,7 +113,7 @@ public void Locate_CompatibleVersionFound_NotificationIsNotShown()
{
var versions = new List<NodeVersionInfo>
{
new("good version", new Version(15, 0))
new("good version", new Version(16, 0))
};

var notificationService = new Mock<IUnsupportedNodeVersionNotificationService>();
Expand All @@ -124,9 +131,13 @@ public void Locate_CompatibleVersionFound_NotificationIsNotShown()
[DataRow(13, 0, false)]
[DataRow(14, 0, false)]
[DataRow(14, 16, false)]
[DataRow(14, 17, true)]
[DataRow(14, 18, true)]
[DataRow(15, 00, true)]
[DataRow(14, 17, false)]
[DataRow(14, 18, false)]
[DataRow(15, 0, false)]
[DataRow(16, 0, true)]
[DataRow(16, 1, true)]
[DataRow(17, 0, true)]
[DataRow(20, 0, true)]
public void IsCompatibleVersion_ReturnsTrueFalse(int majorVersion,int minorVersion, bool expectedResult)
{
var version = new Version(majorVersion, minorVersion);
Expand Down
4 changes: 2 additions & 2 deletions src/TypeScript/NodeJSLocator/CompatibleNodeLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ public NodeVersionInfo Locate()

internal static bool IsCompatibleVersion(Version nodeVersion)
{
// Minimum supported version 14.17.0
return (nodeVersion.Major == 14 && nodeVersion.Minor >= 17) || nodeVersion.Major > 14;
// Minimum supported version 16.0.0
return nodeVersion.Major >= 16;
}
}
}
Loading