@tapjs/filter
Advanced tools
Comparing version 0.0.0-4 to 0.0.0-5
import { PromiseWithSubtest, TapPlugin, TestBase, TestBaseOpts } from '@tapjs/core'; | ||
import type { Test, TestOpts } from '@tapjs/test'; | ||
/** | ||
* Options added by this plugin | ||
* | ||
* @group Test Options | ||
*/ | ||
export interface FilterOptions extends TestBaseOpts { | ||
@@ -23,5 +28,13 @@ /** | ||
} | ||
/** | ||
* Class that provides the {@link Filter#only} method, and extends the | ||
* {@link TestBase#shouldSkipChild} method to respect the grep option | ||
*/ | ||
export declare class Filter { | ||
#private; | ||
constructor(t: TestBase, opts: FilterOptions); | ||
/** | ||
* Run a child test that will run when the `--only` config is set, | ||
* or `{ runOnly: true }` is set in the parent test options. | ||
*/ | ||
only(name: string, extra: TestOpts, cb: (t: Test) => any): PromiseWithSubtest<Test>; | ||
@@ -32,3 +45,11 @@ only(name: string, cb: (t: Test) => any): PromiseWithSubtest<Test>; | ||
} | ||
/** | ||
* plugin method that instantiates a {@link Filter} object | ||
*/ | ||
export declare const plugin: TapPlugin<Filter, FilterOptions>; | ||
/** | ||
* Configuration options added by this plugin | ||
* | ||
* @group Configuration | ||
*/ | ||
export declare const config: { | ||
@@ -35,0 +56,0 @@ only: { |
@@ -5,2 +5,6 @@ "use strict"; | ||
const core_1 = require("@tapjs/core"); | ||
/** | ||
* Class that provides the {@link Filter#only} method, and extends the | ||
* {@link TestBase#shouldSkipChild} method to respect the grep option | ||
*/ | ||
class Filter { | ||
@@ -91,4 +95,12 @@ #t; | ||
exports.Filter = Filter; | ||
/** | ||
* plugin method that instantiates a {@link Filter} object | ||
*/ | ||
const plugin = (t, opts) => new Filter(t, opts); | ||
exports.plugin = plugin; | ||
/** | ||
* Configuration options added by this plugin | ||
* | ||
* @group Configuration | ||
*/ | ||
exports.config = { | ||
@@ -95,0 +107,0 @@ only: { |
import { PromiseWithSubtest, TapPlugin, TestBase, TestBaseOpts } from '@tapjs/core'; | ||
import type { Test, TestOpts } from '@tapjs/test'; | ||
/** | ||
* Options added by this plugin | ||
* | ||
* @group Test Options | ||
*/ | ||
export interface FilterOptions extends TestBaseOpts { | ||
@@ -23,5 +28,13 @@ /** | ||
} | ||
/** | ||
* Class that provides the {@link Filter#only} method, and extends the | ||
* {@link TestBase#shouldSkipChild} method to respect the grep option | ||
*/ | ||
export declare class Filter { | ||
#private; | ||
constructor(t: TestBase, opts: FilterOptions); | ||
/** | ||
* Run a child test that will run when the `--only` config is set, | ||
* or `{ runOnly: true }` is set in the parent test options. | ||
*/ | ||
only(name: string, extra: TestOpts, cb: (t: Test) => any): PromiseWithSubtest<Test>; | ||
@@ -32,3 +45,11 @@ only(name: string, cb: (t: Test) => any): PromiseWithSubtest<Test>; | ||
} | ||
/** | ||
* plugin method that instantiates a {@link Filter} object | ||
*/ | ||
export declare const plugin: TapPlugin<Filter, FilterOptions>; | ||
/** | ||
* Configuration options added by this plugin | ||
* | ||
* @group Configuration | ||
*/ | ||
export declare const config: { | ||
@@ -35,0 +56,0 @@ only: { |
import { env, parseTestArgs, } from '@tapjs/core'; | ||
/** | ||
* Class that provides the {@link Filter#only} method, and extends the | ||
* {@link TestBase#shouldSkipChild} method to respect the grep option | ||
*/ | ||
export class Filter { | ||
@@ -86,3 +90,11 @@ #t; | ||
} | ||
/** | ||
* plugin method that instantiates a {@link Filter} object | ||
*/ | ||
export const plugin = (t, opts) => new Filter(t, opts); | ||
/** | ||
* Configuration options added by this plugin | ||
* | ||
* @group Configuration | ||
*/ | ||
export const config = { | ||
@@ -89,0 +101,0 @@ only: { |
{ | ||
"name": "@tapjs/filter", | ||
"version": "0.0.0-4", | ||
"version": "0.0.0-5", | ||
"description": "tap plugin providing t.only() and grep option", | ||
@@ -38,3 +38,3 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://blog.izs.me)", | ||
"peerDependencies": { | ||
"@tapjs/core": "0.0.0-4" | ||
"@tapjs/core": "0.0.0-5" | ||
}, | ||
@@ -41,0 +41,0 @@ "dependencies": { |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37136
415