parent
3d29b7854b
commit
d9faf17f5c
|
|
@ -13,6 +13,7 @@
|
|||
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="$(AspNetCoreVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="$(AspNetCoreVersion)" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="$(AspNetCoreVersion)" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="$(AspNetCoreVersion)" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="$(AspNetCoreVersion)" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ namespace Microsoft.AspNetCore.SignalR.Test.Server
|
|||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
|
||||
{
|
||||
loggerFactory.AddConsole();
|
||||
loggerFactory.AddDebug(LogLevel.Trace);
|
||||
|
||||
if (env.IsDevelopment())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ describe('hubConnection', () => {
|
|||
.catch(() => {
|
||||
fail();
|
||||
done();
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
it(`over ${transportName} rethrows an exception from the server`, done => {
|
||||
|
|
@ -51,32 +51,32 @@ describe('hubConnection', () => {
|
|||
.catch(() => {
|
||||
fail();
|
||||
done();
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
it(`over ${transportName} can receive server calls`, done => {
|
||||
let client = new signalR.HubConnection(TESTHUBENDPOINT_URL, 'formatType=json&format=text');
|
||||
const message = "Hello SignalR";
|
||||
|
||||
client.on("Message", msg => {
|
||||
expect(msg).toBe(message);
|
||||
client.stop();
|
||||
done();
|
||||
let callbackPromise = new Promise((resolve, reject) => {
|
||||
client.on("Message", msg => {
|
||||
expect(msg).toBe(message);
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
||||
client.start(transportName)
|
||||
.then(() => {
|
||||
client.invoke('InvokeWithString', message)
|
||||
.catch(e => {
|
||||
fail();
|
||||
client.stop();
|
||||
done();
|
||||
});
|
||||
return Promise.all([client.invoke('InvokeWithString', message), callbackPromise]);
|
||||
})
|
||||
.then(() => {
|
||||
stop();
|
||||
done();
|
||||
})
|
||||
.catch(e => {
|
||||
fail();
|
||||
done();
|
||||
})
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue