DongThin / my-love-e2e-testing

e2e testing with cypress
2 stars 0 forks source link

Convert Return Type to Promise for taxCalculator and InsuranceCalculator #12

Closed alang-dev closed 6 months ago

alang-dev commented 6 months ago

Objective:

To facilitate learning and practice with JavaScript Promises, we'll convert the return types of the taxCalculator and InsuranceCalculator functions from synchronous to asynchronous using Promises.

Tasks:

Story of Promise

Once upon a time, there was a hardworking citizen named Alex who needed to calculate their personal income tax (PIT) and arrange insurance coverage. However, these tasks required interacting with external government services, which could take a few days to process.

Alex decided to use JavaScript to automate these processes. They created functions to handle PIT and insurance calculations, but instead of getting immediate results, these functions promised to deliver the information when the government services responded.

With Promises in place, Alex's application could start the calculations and continue with other tasks while waiting for the government services to respond. This saved Alex time and effort, as they didn't have to wait around for the calculations to finish.

In the end, Alex's application was able to efficiently handle PIT and insurance calculations, thanks to the power of Promises, making Alex's life a lot easier!