Showing posts with label testing. Show all posts
Showing posts with label testing. Show all posts

Saturday, February 16, 2019

Getting Started

Getting Started

Let's get started by writing a test for a hypothetical function that adds two numbers. First, create a sum.js file: Then, create a file named sum.test.js. This will contain our actual test:

Sunday, December 31, 2017

Redux Testing Step by Step: A Simple Methodology for Testing Business Logic



Part two of our Redux workflow series. A well-implemented system is only half the work. The other half is an automated suite of tests proving our system is behaving according to spec. This is a crucial factor in increasing our engineering velocity.

Unit testing with Jest: Redux + async actions + fetch



LAST UPDATE: June 24, 2017. Original writing: May 19, 2016. I have been using Jest since its beginnings. I won’t lie, the path has been painful: Things like updating from version 0.x.0 to version 0.y.0 (specially to version 0.4.0) was particularly terrible for my tests.

Thursday, December 21, 2017

Test redux actions that calls an API



export function receivingItems() { return (dispatch, getState) => { axios.get('/api/items') .then(function(response) { dispatch(receivedItems(response.data)); }); }; } describe('Items Action Creator', () => { it('should create a receiving items function', () => { expect(receivingItems()).to.be.a.

bundlephobia

JavaScript bloat is a more real problem today than it ever was. Bundlephobia lets you understand the performance cost of adding a npm pack...