{"id":20395,"date":"2018-03-27T21:00:00","date_gmt":"2018-03-27T21:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/?p=20395"},"modified":"2019-02-14T20:18:21","modified_gmt":"2019-02-15T03:18:21","slug":"unit-testing-your-javascript-code","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/unit-testing-your-javascript-code\/","title":{"rendered":"Unit Testing Your JavaScript Code"},"content":{"rendered":"<p>In a recent post from his blog, Premier Developer Consultant <a href=\"https:\/\/www.linkedin.com\/in\/jimblizzard\/\">Jim Blizzard<\/a> discusses how to set up Visual Studio 2017 to run JavaScript-based unit tests.<\/p>\n<hr>\n<p>This week, I demonstrated to a client how they could write unit tests in JavaScript to test their JavaScript code by leveraging <b>Karma<\/b>, <b>Jasmine<\/b>, and <b>Chutzpah<\/b>. The unit tests show up in Test Explorer just like unit tests written in C# do. Setting things up isn\u2019t very difficult and can be completed in just a few minutes.<\/p>\n<p><p>Let\u2019s take a look at how you can do it in your environment while we start to create a JavaScript library that calculates the score of a bowling game.<\/p>\n<p>Continue reading more on Jim\u2019s <a href=\"https:\/\/jimblizzard.wordpress.com\/2018\/01\/20\/unit-testing-your-javascript-code\/\" target=\"_blank\">blog post<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In a recent post from his blog, Premier Developer Consultant Jim Blizzard discusses how to set up Visual Studio 2017 to run JavaScript-based unit tests. This week, I demonstrated to a client how they could write unit tests in JavaScript to test their JavaScript code by leveraging Karma, Jasmine, and Chutzpah. The unit tests show [&hellip;]<\/p>\n","protected":false},"author":582,"featured_media":37840,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[113],"tags":[109,110,111,112,46],"class_list":["post-20395","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-visual-studio","tag-javascript","tag-jim-blizzard","tag-testing","tag-unit-testing","tag-visual-studio"],"acf":[],"blog_post_summary":"<p>In a recent post from his blog, Premier Developer Consultant Jim Blizzard discusses how to set up Visual Studio 2017 to run JavaScript-based unit tests. This week, I demonstrated to a client how they could write unit tests in JavaScript to test their JavaScript code by leveraging Karma, Jasmine, and Chutzpah. The unit tests show [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/20395","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=20395"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/20395\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/37840"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=20395"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=20395"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=20395"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}