{"id":4865,"date":"2016-12-28T18:00:00","date_gmt":"2016-12-28T18:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/?p=4865"},"modified":"2019-02-18T08:30:02","modified_gmt":"2019-02-18T15:30:02","slug":"unit-testing-using-typescript-mocha-chai-sinon-and-karma","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/unit-testing-using-typescript-mocha-chai-sinon-and-karma\/","title":{"rendered":"Unit testing using Typescript, Mocha, Chai, Sinon, and Karma"},"content":{"rendered":"<p><em>In this post, Premier Developer consultant <a href=\"https:\/\/www.linkedin.com\/in\/waelkdouh\">Wael Kdouh<\/a> outlines how to set up a unit testing project using Typescript, Mocha, Chai, Sinon and Karma.<\/em><\/p>\n<hr \/>\n<p>I was trying to setup a project for unit testing using Typescript, Mocha, Chai, Sinon, and Karma and I quickly realized that there were so many moving parts that made it a bit challenging to setup the project. Here are the detailed steps for successfully creating a JavaScript unit testing project using the aforementioned technologies. TL\/DR:\u00a0 The code is available on <a href=\"https:\/\/github.com\/microsoft\/\">GitHub<\/a>.<\/p>\n<p><a href=\"https:\/\/medium.com\/@waelkdouh\/unit-testing-using-typescript-mocha-chai-sinon-and-karma-de1fddafd42a\">Continue reading on Wael&#8217;s blog<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this post, Premier Developer consultant Wael Kdouh outlines how to set up a unit testing project using Typescript, Mocha, Chai, Sinon and Karma. I was trying to setup a project for unit testing using Typescript, Mocha, Chai, Sinon, and Karma and I quickly realized that there were so many moving parts that made it [&hellip;]<\/p>\n","protected":false},"author":581,"featured_media":37840,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[175,255,272,339,3,111,366,98],"class_list":["post-4865","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-permierdev","tag-chai","tag-karma","tag-mocha","tag-sinon","tag-team","tag-testing","tag-typescript","tag-wael-kdouh"],"acf":[],"blog_post_summary":"<p>In this post, Premier Developer consultant Wael Kdouh outlines how to set up a unit testing project using Typescript, Mocha, Chai, Sinon and Karma. I was trying to setup a project for unit testing using Typescript, Mocha, Chai, Sinon, and Karma and I quickly realized that there were so many moving parts that made it [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/4865","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\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=4865"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/4865\/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=4865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=4865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=4865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}