Our site uses cookies. Learn more about their purpose and change of settings in a browser If you are using the site, you give you consent to use cookies, according to current browser settings. Got it

Promise bug

  • Language JavaScript
Fix promise broken chain. `app.js` contains a first attempt to solve this, but not all tests are passing.

Promise bug

Summary

You should fix this promise broken chain.

Goal

We've got a function called app, that accepts 3 callbacks. Each callback returns a promise. First, it should invoke callback A. If A resolves it, the app should invoke B with the value resolved by A on param. If A rejects it, the error should be handled by C and B should not be invoked. In this case the app should return the result of C invocation. If both A and B resolve, the app should return the value resolved by B.

app.js contains the first attempt to solve this, but not all tests are passing. Please fix that.

Setup

To install dependencies from package.json:

npm install

To run tests in development mode:

mocha --watch

To run jshint and tests:

npm test

To run jshint and tests with human readable output:

grunt --force

Start this test

Labnoratory Academy Ltd (Realskill) is a Data Controller. Personal data will be processed to facilitate IT skill test. More
... Przewidywane kategorie odbiorców danych: pracownicy Bulldogjob oraz Labnoratory Academy Ltd. Podmiotowi danych przysługuje prawo do żądania dostępu do danych dotyczących swojej osoby, ich sprostowania, usunięcia, ograniczenia przetwarzania, do przenoszenia danych oraz wniesienia skargi do organu nadzorczego.
Go to the top and begin