public async void CanStopServer() { var port = await Server.StartServer(60000); var stopCommand = new JsTestAdapter.TestServerClient.StopCommand(port); await stopCommand.Run(); var exitCode = await Server.Finished; Logger.Info("[Test] Exit code: {0}", exitCode); }
public async void CanStopServer() { var port = await Server.StartServer(60000); var stopCommand = new JsTestAdapter.TestServerClient.StopCommand(port); await stopCommand.Run(); var exitCode = await Server.Finished; Logger.Info("[Test] Exit code: {0}", exitCode); }
public async void KarmaGetsDifferentPort() { var karmaPortTCS = new TaskCompletionSource<int>().SetTimeout(60000); Server.OutputReceived += line => { var match = Regex.Match(line, @"\[karma\]:\s+Karma\s+.*\s+server started at http://[^:]+:(\d+)"); if (match.Success) { karmaPortTCS.TrySetResult(int.Parse(match.Groups[1].Value)); } }; var port = await Server.StartServer(60000); var karmaPort = await karmaPortTCS.Task; var stopCommand = new JsTestAdapter.TestServerClient.StopCommand(port); await stopCommand.Run(); var exitCode = await Server.Finished; Logger.Info("[Test] Exit code: {0}", exitCode); Assert.That(karmaPort, Is.GreaterThan(0)); Assert.That(karmaPort, Is.Not.EqualTo(port)); }