Welcome to the Linux Foundation Forum!

Unit Tests - Assertions

Hello,

At the very end of the Assertions sections, there is this code;

  1. const pseudoReq = async (url) => {
  2. await timeout(300)
  3. if (url === 'http://error.com') throw Error('network error')
  4. return Buffer.from('some data')
  5. }
  6. assert.doesNotReject(pseudoReq('http://example.com'))
  7. assert.rejects(pseudoReq('http://error.com'), Error('network error'))

I think the second line from last is erroneous.

Can you confirm if that is the case?

Comments

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training