Salakhetdinov Shamil
mcp2004 at mail.ru
Sat Jun 8 13:52:22 CDT 2013
Hi All -- Not sure if subject is a generally available in one place/ready to use info - so I'm trying to compile it from several sources and to post it here: Context: Given AngularJS tutorial - http://docs.angularjs.org/tutorial Quiz: How one can work through this tutorial (including running its JavaScript - Jasmine - unit tests) from within Visual Studio 2012? Solution: 1. Get and setup - "Chutzpah Test Adapter for Visual Studio 2012" http://visualstudiogallery.msdn.microsoft.com/f8741f04-bae4-4900-81c7-7c9bfb9ed1fe 2. Start VS 2012 and create an empty web project. 3. Put tutorial's entry html with AngularJS directives into default.html 4 . Put JavaScript code from tutorial into source file(s) in /js sub-folder 5. Put JavaScript code from tutorial with jasmine unit tests into source file(s) in /tests/unit sub-folder 6. Use /// <reference path="../../js/<your file name here>.js" /> directive in JavaScript code jasmine unit test sources 7. Run unit tests from within VS2012 in Unit Tests Explorer http://msdn.microsoft.com/en-us/library/hh270865.aspx#BKMK_Running_tests 8. Run, edit, refresh your web app (default.html in the very beginning) by using VS 2012 Page Inspector - CTRL + K, CTRL + G. http://www.asp.net/vnext/overview/visual-studio/visual-studio-2012-page-inspector (As usual you can just run your web app in a browser by using CTRL+F5 (run) or F5 (run in debug mode)) 9. Enjoy! P.S. See also: Running JavaScript tests with Chutzpah http://chutzpah.codeplex.com/wikipage?title=runTests&referringTitle=Home -- Салахетдинов Шамиль