<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>jest on Curtis Timson</title><link>https://hugo.curtiscode.dev/tags/jest/</link><description>Recent content in jest on Curtis Timson</description><generator>Hugo -- gohugo.io</generator><language>en-GB</language><lastBuildDate>Tue, 14 Aug 2018 17:27:00 +0000</lastBuildDate><atom:link href="https://hugo.curtiscode.dev/tags/jest/index.xml" rel="self" type="application/rss+xml"/><item><title>ReactJs Snapshot unit testing and mocking components</title><link>https://hugo.curtiscode.dev/post/reactjs/reactjs-jest-snapshot-mocking/</link><pubDate>Tue, 14 Aug 2018 17:27:00 +0000</pubDate><guid>https://hugo.curtiscode.dev/post/reactjs/reactjs-jest-snapshot-mocking/</guid><description>What are Jest Snapshots? Snapshot ReactJs Components Mocking ReactJs Components GitHub Repository What are Jest Snapshots? Jest is a javascript unit testing framework developed by Facebook. This is primarily used with React, however can also be used with other frameworks, such as AngularJs.
Snapshots are a feature of Jest which will record an expected output state of a component.
Capture snapshots of React trees or other serializable values to simplify testing and to analyze how state changes over time.</description></item><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>