Skip to content

article-examples/promise-unit-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

What is Promise?

The Promise is an Object introduced in ECMA Script 2015 as part of 6th Edition. It represents the future completion of Success / Failure Operation. It mainly helps to works smoothly with asynchronous operations. Promise API is mainly followed Promises/A+ Specification.

Why we need Promise?

For Instance, You have submitted the email form / search form and waiting for the response. In that case, you will not be sure when server will respond and its bit hard to predict the time and get the actual message after that particular execution time for the response. Promise can help to fix this issue.

Simple Promise

Take a look at below snippet which uses Promise API where it catches the success message after few seconds and you can increase time in setTimeout method as well but console triggers whenever its get the message. In this example, We used timeout function to return after few seconds like server response.

Click here to Read More about Promise Unit Testing

About

Promise Unit Tesing with Async and Promise API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published