<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>npm on Curtis Timson</title><link>https://hugo.curtiscode.dev/tags/npm/</link><description>Recent content in npm on Curtis Timson</description><generator>Hugo -- gohugo.io</generator><language>en-GB</language><lastBuildDate>Fri, 17 Nov 2017 18:00:00 +0000</lastBuildDate><atom:link href="https://hugo.curtiscode.dev/tags/npm/index.xml" rel="self" type="application/rss+xml"/><item><title>AngularJs with Jest Unit Testing</title><link>https://hugo.curtiscode.dev/post/angularjs/angularjs-jest-unit-testing/</link><pubDate>Fri, 17 Nov 2017 18:00:00 +0000</pubDate><guid>https://hugo.curtiscode.dev/post/angularjs/angularjs-jest-unit-testing/</guid><description>Jest, a unit testing framework by Facebook, is commonly associated with the React JS library. However Jest is not specifically for React, and can be used to test any javascript code you wish.
Recently I&amp;rsquo;ve been using Jest with AngularJs 1.6 and have put together the following step-by-step guide on how to get setup.
This guide includes:
Installing Angular Mocks and Jest CLI Creating an AngularJs Service Create Jest unit test file Running Jest tests with failed example Correcting service and running successful Jest tests Checking code coverage of tests TL;DR - Full Working Example on GitHub Install Angular Mocks and Jest CLI To use Jest with AngularJs you will require the Angular Mocks and Jest CLI packages, which can be installed using npm:</description></item></channel></rss>