Skip to content

Commit 1afe73b

Browse files
committed
Nicer test return values
1 parent 9e25767 commit 1afe73b

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

test/unit/error.spec.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -258,20 +258,23 @@ test("multi return from catch->finally", () => {
258258

259259
test("throw propagates through finally to outer catch", () => {
260260
util.testFunction`
261-
function test() {
261+
function thrower() {
262262
try {
263-
throw "Test error";
263+
throw "Error";
264264
} finally {
265265
}
266266
}
267267
268-
let result = 0;
269-
try {
270-
test();
271-
} catch (e) {
272-
result += 1;
268+
function caller() {
269+
try {
270+
thrower();
271+
return "NoCatch";
272+
} catch (e) {
273+
return e;
274+
}
273275
}
274-
return result;
276+
277+
return caller();
275278
`.expectToMatchJsResult();
276279
});
277280

0 commit comments

Comments
 (0)