Skip to content

Commit 927def4

Browse files
author
Paul van Brenk
committed
PR feedback
1 parent ece9058 commit 927def4

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

Nodejs/Product/Nodejs/Workspace/PackageJsonTestContainerDiscoverer.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,22 +62,23 @@ public IEnumerable<ITestContainer> TestContainers
6262

6363
private async Task AttemptUpdateAsync()
6464
{
65-
if (this.currentWorkspace != null)
65+
var workspace = this.currentWorkspace;
66+
if (workspace != null)
6667
{
67-
var indexServce = this.currentWorkspace.GetIndexWorkspaceService();
68-
var filesDataValues = await indexServce.GetFilesDataValuesAsync<string>(NodejsConstants.TestRootDataValueGuid);
68+
var indexService = workspace.GetIndexWorkspaceService();
69+
var filesDataValues = await indexService.GetFilesDataValuesAsync<string>(NodejsConstants.TestRootDataValueGuid);
6970

7071
lock (this.containerLock)
7172
{
7273
this.containers.Clear();
7374
foreach (var dataValue in filesDataValues)
7475
{
75-
var rootFilePath = this.currentWorkspace.MakeRooted(dataValue.Key);
76-
var testRoot = dataValue.Value.Where(f => f.Name == "TestRoot").Select(f => f.Value).FirstOrDefault();
76+
var rootFilePath = workspace.MakeRooted(dataValue.Key);
77+
var testRoot = dataValue.Value.Where(f => f.Name == "TestRoot").FirstOrDefault()?.Value;
7778

7879
if (!string.IsNullOrEmpty(testRoot))
7980
{
80-
var testRootPath = this.currentWorkspace.MakeRooted(testRoot);
81+
var testRootPath = workspace.MakeRooted(testRoot);
8182
this.containers.Add(new PackageJsonTestContainer(this, rootFilePath, testRootPath));
8283
}
8384
}

Nodejs/Product/TestAdapter/JavaScriptTestDiscoverer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private void DiscoverTests(Dictionary<string, HashSet<TestFileEntry>> testItems,
161161
var testCount = 0;
162162
foreach (var testFx in testItems.Keys)
163163
{
164-
var testFramework = FrameworkDiscover.Intance.Get(testFx);
164+
var testFramework = FrameworkDiscoverer.Instance.Get(testFx);
165165
if (testFramework == null)
166166
{
167167
logger.SendMessage(TestMessageLevel.Warning, $"Ignoring unsupported test framework '{testFx}'.");

Nodejs/Product/TestAdapter/PackageJsonTestDiscoverer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ private void DiscoverTestFiles(string packageJsonPath, IMessageLogger logger, IT
5252

5353
foreach (var dep in packageJson.AllDependencies)
5454
{
55-
testFx = FrameworkDiscover.Intance.Get(dep.Name);
55+
testFx = FrameworkDiscoverer.Instance.Get(dep.Name);
5656
if (testFx != null)
5757
{
5858
break;
5959
}
6060
}
61-
testFx = testFx ?? FrameworkDiscover.Intance.Get("ExportRunner");
61+
testFx = testFx ?? FrameworkDiscoverer.Instance.Get("ExportRunner");
6262

6363
var nodeExePath = Nodejs.GetPathToNodeExecutableFromEnvironment();
6464

Nodejs/Product/TestAdapter/TestExecutorWorker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ private static TestFramework.ArgumentsToRunTests GetInterpreterArgs(TestCase tes
356356
{
357357
var testFile = test.GetPropertyValue(JavaScriptTestCaseProperties.TestFile, defaultValue: test.CodeFilePath);
358358
var testFramework = test.GetPropertyValue<string>(JavaScriptTestCaseProperties.TestFramework, defaultValue: null);
359-
return FrameworkDiscover.Intance.Get(testFramework).GetArgumentsToRunTests(test.DisplayName, testFile, workingDir, projectRootDir);
359+
return FrameworkDiscoverer.Instance.Get(testFramework).GetArgumentsToRunTests(test.DisplayName, testFile, workingDir, projectRootDir);
360360
}
361361

362362
private static string GetDebugArgs(Version nodeVersion, out int port)

Nodejs/Product/TestAdapter/TestFrameworks/FrameworkDiscover.cs renamed to Nodejs/Product/TestAdapter/TestFrameworks/FrameworkDiscoverer.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
namespace Microsoft.NodejsTools.TestAdapter.TestFrameworks
88
{
9-
public sealed class FrameworkDiscover
9+
public sealed class FrameworkDiscoverer
1010
{
1111
private readonly Dictionary<string, TestFramework> frameworks = new Dictionary<string, TestFramework>(StringComparer.OrdinalIgnoreCase);
1212

13-
public static FrameworkDiscover Intance = new FrameworkDiscover();
13+
public static FrameworkDiscoverer Instance = new FrameworkDiscoverer();
1414

15-
private FrameworkDiscover()
15+
private FrameworkDiscoverer()
1616
{
1717
var testFrameworkDirectories = TestFrameworkDirectories.GetFrameworkDirectories();
1818

0 commit comments

Comments
 (0)