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

Run all tests in karma #4603

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/Microsoft.AspNet.SignalR.Client.JS.Tests/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void Configuration(IAppBuilder app)
// Inject server settings in to the javascript
context.Response.StatusCode = 200;
context.Response.ContentType = "application/javascript";
await context.Response.WriteAsync($"window._server = {{ azureSignalR: {(string.IsNullOrEmpty(AzureSignalRConnectionString) ? "false" : "true")} }}");
await context.Response.WriteAsync($"window._server.azureSignalR = {(string.IsNullOrEmpty(AzureSignalRConnectionString) ? "false" : "true")} }}");
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<script src="lib/qunit/qunit.js"></script>
<script src="lib/networkmock/jquery.network.mock.js"></script>
<script src="lib/signalr/jquery.signalR.js"></script>
<script src="js/server-info.js"></script>
<script src="js/boot.js"></script>
<script src="js/server-info.js"></script>

<!-- signalr/js will be auto-injected by the test.config.js file -->

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

testUtilities.module("Server Sent Events Functional Tests", testUtilities.transports.serverSentEvents.enabled, !window._server.azureSignalR);
testUtilities.module("Server Sent Events Functional Tests", testUtilities.transports.serverSentEvents.enabled && !window._server.azureSignalR);

QUnit.asyncTimeoutTest("Attempts to reconnect at the correct interval.", testUtilities.defaultTestTimeout * 2, function (end, assert, testName) {
var connection = testUtilities.createConnection("signalr", end, assert, testName),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

testUtilities.module("WebSockets Functional Tests", testUtilities.transports.webSockets.enabled, !window._server.azureSignalR);
testUtilities.module("WebSockets Functional Tests", testUtilities.transports.webSockets.enabled && !window._server.azureSignalR);

QUnit.asyncTimeoutTest("WebSocket invalid state sends trigger connection error.", testUtilities.defaultTestTimeout, function (end, assert, testName) {
var connection = testUtilities.createTestConnection(testName, end, assert, { ignoreErrors: true }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ window.onerror = function(message) {
// We don't get much detail in this handler :(. This might be too broad...
return message === "Script error.";
}
};
};

// Make sure window._server is defined for karma tests which do not load js/server-info.js
window._server = {};