message: tests: update callbacks test to include error rethrow scenario
diff: @@ -203,6 +203,34 @@ describe('Callbacks', () => {
  curl.perform()
  })
  + it('should rethrow error thrown inside callback', (done) => {
  + curl.setOpt('URL', `${url}/headers`)
  + curl.setOpt('UPLOAD', true)
  + curl.setOpt('HTTPHEADER', ['x-random-header: random-value'])
  + // @ts-ignore
  + curl.setOpt('TRAILERFUNCTION', () => {
  + throw new Error('thrown error inside callback')
  + })
  +
  + curl.setOpt(Curl.option.READFUNCTION, (buffer, size, nmemb) => {
  + const data = 'HELLO'
  + buffer.write(data)
  + return 0
  + })
  +
  + curl.on('end', () => {
  + done(new Error('end called - request wast not aborted by request'))
  + })
  +
  + curl.on('error', (error, errorCode) => {
  + error.message.should.be.equal('thrown error inside callback')
  + errorCode.should.be.equal(CurlCode.CURLE_ABORTED_BY_CALLBACK)
  + done()
  + })
  +
  + curl.perform()
  + })
  +
  it('should throw an error on invalid return value', (done) => {
  curl.setOpt('URL', `${url}/headers`)
  curl.setOpt('UPLOAD', true)
  