@tapjs/before
Advanced tools
Comparing version
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.plugin = exports.Before = void 0; | ||
const is_actual_promise_1 = require("is-actual-promise"); | ||
class Before { | ||
@@ -29,3 +30,3 @@ #t; | ||
// TestBase will already wait on functions that return promises. | ||
if (isPromise(ret) && !deferred) { | ||
if ((0, is_actual_promise_1.isPromise)(ret) && !deferred) { | ||
this.#t.waitOn(ret, w => { | ||
@@ -47,3 +48,2 @@ if (w.rejected) { | ||
exports.plugin = plugin; | ||
const isPromise = (p) => !!p && typeof p === 'object' && typeof p.then === 'function'; | ||
//# sourceMappingURL=index.js.map |
@@ -0,1 +1,2 @@ | ||
import { isPromise } from 'is-actual-promise'; | ||
export class Before { | ||
@@ -41,3 +42,2 @@ #t; | ||
export const plugin = (t) => new Before(t); | ||
const isPromise = (p) => !!p && typeof p === 'object' && typeof p.then === 'function'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@tapjs/before", | ||
"version": "0.0.0-2", | ||
"version": "0.0.0-3", | ||
"description": "a built-in tap extension for t.before()", | ||
@@ -47,3 +47,3 @@ "main": "./dist/cjs/index.js", | ||
"peerDependencies": { | ||
"@tapjs/core": "0.0.0-2" | ||
"@tapjs/core": "0.0.0-3" | ||
}, | ||
@@ -56,3 +56,6 @@ "engines": { | ||
"url": "git+https://github.com/tapjs/tapjs.git" | ||
}, | ||
"dependencies": { | ||
"is-actual-promise": "^1.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
12786
-2.51%2
100%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed