Mocking .NET Web API #1473
|
I've seen the phrase a couple of times that this library integrates with a NodeJS environment. Does that mean that if I use .NET for backend and run React on the front end, MSW will not work for me since I have the .NET backend? |
Replies: 1 comment 1 reply
|
Hey, @BWootBIJC. The question is what part do you intend to mock. If you want to mock the communication between your React app and your .NET server, then MSW is absolutely your choice. It doesn't matter from the library's perspective in which language your actual backend is written, if at all. If you wish to mock some HTTP requests in your .NET backend, which is written in a language other than JavaScript, MSW cannot run there so that won't be your choice. The mention of browser and Node.js in MSW means that the library can run in those two environments. Browser support covers anything you may run in the browser (your frontend app is a good example of that), and Node.js support means that you can mock HTTP requests within Node, which includes:
|
Hey, @BWootBIJC.
The question is what part do you intend to mock. If you want to mock the communication between your React app and your .NET server, then MSW is absolutely your choice. It doesn't matter from the library's perspective in which language your actual backend is written, if at all. If you wish to mock some HTTP requests in your .NET backend, which is written in a language other than JavaScript, MSW cannot run there so that won't be your choice.
The mention of browser and Node.js in MSW means that the library can run in those two environments. Browser support covers anything you may run in the browser (your frontend app is a good example of that), and Node.js support means that…