Skip to content

These questions are missing in src/07_promise.test.js, but in the solution. #3

@wisteria-hill-technologies

Description

The below questions are missing in src/07_promise.test.js in master branch, but exist in the solution.
Do we want to add them to the master branch? or remove them from the solution branch?

it('the `resolve` function can return a value, that is consumed by the `promise.then()` callback', (done) => {
      let promise = new Promise((resolve) => {
        resolve()
      })

      promise
        .then(value => {
          expect(value).toEqual(42)
          done()
        })
        .catch(() => done(new Error('The promise is expected to resolve with 42!')))
    })

also

it('is rejected if one rejects', (done) => {
      const promise = Promise.all([
        new Promise((resolve, reject) => reject(1))
      ])

      promise
        .then(() => {
          const err = new NotRejectedError()
          console.log(err)
          done()
        })
        .catch(() => done())
    })

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions