@fakehost/signalr
v1.0.0-beta.3
Published
A Fake Signalr Service for faking/mocking signalr hub services for testing, prototyping, and demoing
Downloads
153
Maintainers
Readme
@fakehost/signalr
A fake version of the Signalr protocol.
- can be run as a localhost service, or bundled within a web browser.
- used for testing client side ui code deeply against a known (fake) backend
- contract tests to ensure the fake matches the remote
- supports JSON and message pack wire protocols
Best place to look is the at the test fake service
See also
See testing in Playwright for playwright setup.
See testing in cypress for cypress setup.
See bundling fakes in a web application for creating standalone demo apps, or similar e.g storybook.
See running as a local service
## Tests
As @fakehost/signalr
is a fake version of a real dotnet signalr service.
There is a real signalr server
signalr-test-dotnet-svc
. This is a real dotnet signalr service. We use a typescript client generation toolTypedSignalR
to generate a typescript client library for calling this remote service. This generate code is outputted tosignalr-test-client-api
There is a fake implementation of the hubs from the dotnet service
signalr-test-dotnet-svc
in thesignalr-test-fake-svc
. This is a nodejs fake implementations of the real dotnet services.Along with the fake implementation in
signalr-test-fake-svc
there are contract tests for each hub. These contract tests run against the fakes (yarn test
) and are also run against the real dotnet service (yarn test:contract
). This ensures that fake version has the exact same behaviour as the real dotnet service, and as such:
The @fakehost/signalr behaves identically to a real dotnet signalr service
License
@fakehost/signalr is licensed under the MIT License.