Reputation: 892
Is it possible to unit test javascript that is embedded in a razor(.cshtml) view with Visual Studio Test Explorer? I briefly looked at Chutzpah, but it looks like the javascript has to be separated into its own file.
Upvotes: 2
Views: 812
Reputation: 11320
You have to reference it some way in Chutzpah. They only way to do that is by putting it in a separate file.
/// <reference path="yourjsfiletotest.js" />
Tight-coupling JS and HTML code is no way to write testable code.
Upvotes: 1