Posts

Showing posts from October, 2018

Applying React and Typescript API Calls unit test using Sinon

Purpose: The objective of this document is to describe guidance, recommendations, and practices for applying developer test for API calls using Sinon library for mocking API calls. Prerequisites: This article mainly targets people with the knowledge of the followings: -          React -          TypeScript -          NodeJS -          Unit testing with Jest Overview: Sinon is a standalone and test framework agnostic JavaScript test spies, stubs and mocks. Let’s go through some important methods we can use from Sinon during our unit test. ·      Sandboxes var sandbox = sinon.createSandbox(); Creates a new sandbox object with spies, stubs, and mocks. var sandbox = sinon.createSandbox(config); The  sinon.createSandbox(config)  method is ...

Applying unit test for Redux-Saga with React and Typescript

Purpose: The objective of this document is to describe guidance, recommendations, and practices for applying developer test for Redux Saga using React and Typescript. Prerequisites: This article mainly targets people with the knowledge of the followings: -         React -         Redux -         TypeScript -         NodeJS -         Unit testing with Jest -         Using Redux-Saga Library to manage async calls in web App Redux Saga test using “redux-saga-test-plan”: During this article we will mainly use Redux Saga Test Plan to test exact effects and their ordering or to test your saga put's a specific action at some point. Redux Saga Test Plan aims to embrace both unit testing and integration testing approaches to make testing your sag...