@@ -882,11 +882,16 @@ test('.throws()', gather(t => {
882882 throw new Error ( 'foo' ) ;
883883 } ) , { expectBoolean : false } ) ;
884884
885- // Passes when string is thrown, only when any is set to true.
885+ // Passes when string is thrown and `expectation. any` is true.
886886 passes ( t , ( ) => assertions . throws ( ( ) => {
887887 throw 'foo' ; // eslint-disable-line no-throw-literal
888888 } , { any : true } ) , { expectBoolean : false } ) ;
889889
890+ // Passes when false is thrown and `expectation.any` is true.
891+ passes ( t , ( ) => assertions . throws ( ( ) => {
892+ throw false ; // eslint-disable-line no-throw-literal
893+ } , { any : true } ) , { expectBoolean : false } ) ;
894+
890895 // Passes because the correct error is thrown.
891896 passes ( t , ( ) => {
892897 const error = new Error ( 'foo' ) ;
@@ -1098,9 +1103,12 @@ test('.throwsAsync()', gather(t => {
10981103 // Passes because the promise was rejected with an error.
10991104 throwsAsyncPasses ( t , ( ) => assertions . throwsAsync ( Promise . reject ( new Error ( ) ) ) ) ;
11001105
1101- // Passes because the promise was rejected with an with an non-error exception, & set ` any` to true in expectation .
1106+ // Passes because the promise was rejected with a non-error reason and `expectation. any` is true.
11021107 throwsAsyncPasses ( t , ( ) => assertions . throwsAsync ( Promise . reject ( 'foo' ) , { any : true } ) ) ; // eslint-disable-line prefer-promise-reject-errors
11031108
1109+ // Passes because the promise was rejected with a falsy non-error reason and `expectation.any` is true.
1110+ throwsAsyncPasses ( t , ( ) => assertions . throwsAsync ( Promise . reject ( ) , { any : true } ) ) ;
1111+
11041112 // Passes because the function returned a promise rejected with an error.
11051113 throwsAsyncPasses ( t , ( ) => assertions . throwsAsync ( ( ) => Promise . reject ( new Error ( ) ) ) ) ;
11061114
0 commit comments