Skip to content

Commit 5f74ff6

Browse files
authored
Merge pull request #331 from HamedMoghadasi/patch-1
Update emulating-ijsruntime.md
2 parents 87bf370 + bf97c7b commit 5f74ff6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/site/docs/test-doubles/emulating-ijsruntime.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: Emulating Blazor's IJSRuntime
77

88
It is common for Blazor components to use `IJSRuntime` to call JavaScript, and since bUnit does not run JavaScript, emulating `IJSRuntime` is needed for components that uses it. In that regard, `IJSRuntime` is no different than other services that a component might depend on.
99

10-
bUnit comes with it's own JSInterop, a tailor built implementation of `IJSRuntime` that is _active by default_, allowing you to specify how JavaScript interop calls should be handled, what values they calls should return, and also allowing you to verify that they the calls have happened. The implementation is running in "strict mode", which means means it will throw an exception if it receives an invocation it has not been configured to handle. See more about strict vs loose mode in the following section.
10+
bUnit comes with it's own JSInterop, a tailor built implementation of `IJSRuntime` that is _active by default_, allowing you to specify how JavaScript interop calls should be handled, what values they calls should return, and also allowing you to verify that they the calls have happened. The implementation is running in "strict mode", which means it will throw an exception if it receives an invocation it has not been configured to handle. See more about strict vs loose mode in the following section.
1111

1212
If you prefer to use the same mocking framework for all mocking in your tests to keep things consistent, general purpose mocking frameworks like [Moq](https://github.com/Moq), [JustMock Lite](https://github.com/telerik/JustMockLite), or [NSubstitute](https://nsubstitute.github.io/) all works nicely with bUnit and can be used to mock `IJSRuntime`. In general, registering an implementation of `IJSRuntime` with bUnit's `Services` collection replaces bUnit's implementation.
1313

0 commit comments

Comments
 (0)