This repository has been archived by the owner on Dec 18, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 445
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Making the client and tests work on IE
- Loading branch information
Pawel Kadluczka
committed
Aug 29, 2017
1 parent
ff2bf5a
commit 2a36aa1
Showing
9 changed files
with
188 additions
and
226 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 37 additions & 40 deletions
77
client-ts/Microsoft.AspNetCore.SignalR.Test.Server/wwwroot/js/connectionTests.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,58 @@ | ||
describe('connection', () => { | ||
it(`can connect to the server without specifying transport explicitly`, done => { | ||
const message = "Hello World!"; | ||
let connection = new signalR.HttpConnection(ECHOENDPOINT_URL); | ||
"use strict"; | ||
|
||
let received = ""; | ||
connection.onDataReceived = data => { | ||
describe('connection', function () { | ||
it("can connect to the server without specifying transport explicitly", function (done) { | ||
var message = "Hello World!"; | ||
var connection = new signalR.HttpConnection(ECHOENDPOINT_URL); | ||
|
||
var received = ""; | ||
connection.onDataReceived = function (data) { | ||
received += data; | ||
if (data == message) { | ||
connection.stop(); | ||
} | ||
} | ||
}; | ||
|
||
connection.onClosed = error => { | ||
connection.onClosed = function (error) { | ||
expect(error).toBeUndefined(); | ||
done(); | ||
} | ||
}; | ||
|
||
connection.start() | ||
.then(() => { | ||
connection.send(message); | ||
}) | ||
.catch(e => { | ||
fail(); | ||
done(); | ||
}); | ||
connection.start().then(function () { | ||
connection.send(message); | ||
}).catch(function (e) { | ||
fail(); | ||
done(); | ||
}); | ||
}); | ||
|
||
eachTransport(transportType => { | ||
it(`over ${signalR.TransportType[transportType]} can send and receive messages`, done => { | ||
const message = "Hello World!"; | ||
let connection = new signalR.HttpConnection(ECHOENDPOINT_URL, | ||
{ | ||
transport: transportType, | ||
logger: new signalR.ConsoleLogger(signalR.LogLevel.Information) | ||
}); | ||
|
||
let received = ""; | ||
connection.onDataReceived = data => { | ||
eachTransport(function (transportType) { | ||
it("over " + signalR.TransportType[transportType] + " can send and receive messages", function (done) { | ||
var message = "Hello World!"; | ||
var connection = new signalR.HttpConnection(ECHOENDPOINT_URL, { | ||
transport: transportType, | ||
logger: new signalR.ConsoleLogger(signalR.LogLevel.Information) | ||
}); | ||
|
||
var received = ""; | ||
connection.onDataReceived = function (data) { | ||
received += data; | ||
if (data == message) { | ||
connection.stop(); | ||
} | ||
} | ||
}; | ||
|
||
connection.onClosed = error => { | ||
connection.onClosed = function (error) { | ||
expect(error).toBeUndefined(); | ||
done(); | ||
} | ||
}; | ||
|
||
connection.start() | ||
.then(() => { | ||
connection.send(message); | ||
}) | ||
.catch(e => { | ||
fail(); | ||
done(); | ||
}); | ||
connection.start().then(function () { | ||
connection.send(message); | ||
}).catch(function (e) { | ||
fail(); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.