@bicycle-codes/tapzero
Advanced tools
+4
-10
@@ -246,5 +246,5 @@ "use strict"; | ||
| * @param {string} [message] | ||
| * @returns {void} | ||
| * @returns {Promise<void>} | ||
| */ | ||
| throws(fn, expected, message) { | ||
| async throws(fn, expected, message) { | ||
| if (typeof expected === "string") { | ||
@@ -258,3 +258,3 @@ message = expected; | ||
| try { | ||
| fn(); | ||
| await fn(); | ||
| } catch (err) { | ||
@@ -270,9 +270,3 @@ caught = /** @type {Error} */ | ||
| } | ||
| this._assert( | ||
| pass, | ||
| caught, | ||
| expected, | ||
| message || "should throw", | ||
| "throws" | ||
| ); | ||
| this._assert(pass, caught, expected, message || "should throw", "throws"); | ||
| } | ||
@@ -279,0 +273,0 @@ /** |
+2
-2
@@ -131,5 +131,5 @@ /** | ||
| * @param {string} [message] | ||
| * @returns {void} | ||
| * @returns {Promise<void>} | ||
| */ | ||
| throws(fn: Function, expected?: RegExp | any, message?: string): void; | ||
| throws(fn: Function, expected?: RegExp | any, message?: string): Promise<void>; | ||
| /** | ||
@@ -136,0 +136,0 @@ * @param {boolean} pass |
+4
-10
@@ -216,5 +216,5 @@ var __defProp = Object.defineProperty; | ||
| * @param {string} [message] | ||
| * @returns {void} | ||
| * @returns {Promise<void>} | ||
| */ | ||
| throws(fn, expected, message) { | ||
| async throws(fn, expected, message) { | ||
| if (typeof expected === "string") { | ||
@@ -228,3 +228,3 @@ message = expected; | ||
| try { | ||
| fn(); | ||
| await fn(); | ||
| } catch (err) { | ||
@@ -240,9 +240,3 @@ caught = /** @type {Error} */ | ||
| } | ||
| this._assert( | ||
| pass, | ||
| caught, | ||
| expected, | ||
| message || "should throw", | ||
| "throws" | ||
| ); | ||
| this._assert(pass, caught, expected, message || "should throw", "throws"); | ||
| } | ||
@@ -249,0 +243,0 @@ /** |
+1
-1
| { | ||
| "name": "@bicycle-codes/tapzero", | ||
| "version": "0.10.2", | ||
| "version": "0.10.3", | ||
| "description": "Smallest test library", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
42219
-0.03%1254
-0.95%