gast icon indicating copy to clipboard operation
gast copied to clipboard

t.throws(fn) does not catch the exception thrown

Open e18r opened this issue 7 years ago • 3 comments

t.throws(fn) does not catch the exception thrown, making the test function to fail.

Here's how to reproduce the problem:

if ((typeof GasTap)==='undefined') {
  eval(UrlFetchApp.fetch('https://raw.githubusercontent.com/zixia/gast/master/src/gas-tap-lib.js').getContentText())
}

var test = new GasTap()

function gastTestRunner() {
  test('do calculation right', function (t) {    
    t.throws(UrlFetchApp.fetch("hi"));
  })
}

e18r avatar Feb 08 '18 04:02 e18r

Hi,

Did you find the reason that caused this problem?

A Pull Request to fix this will be very welcome, and thanks for the reporting!

huan avatar Sep 09 '18 03:09 huan

To be quite frank, I don't really remember what happened with this, but I think I probably stopped using gast altogether.

e18r avatar Sep 09 '18 15:09 e18r

That's ok. I was doing housekeeping today and found some missed issues here and there.

Have a good day!

huan avatar Sep 09 '18 17:09 huan