Skip to content

Commit fb421ae

Browse files
committed
Provide some debug output upon spec filtering
This might be usefull in debugging issues such as #1181 [1], where user error and terminal unfamiliarity is the actual root cause. [1] #1181
1 parent bf8fcff commit fb421ae

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/add-cucumber-preprocessor-plugin.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import fs from "fs";
22

3+
import { inspect } from "node:util";
4+
35
import { IdGenerator, SourceMediaType } from "@cucumber/messages";
46

57
import parse from "@cucumber/tag-expressions";
@@ -47,6 +49,8 @@ import { memoize } from "./helpers/memoize";
4749

4850
import { assertNever } from "./helpers/assertions";
4951

52+
import debug from "./helpers/debug";
53+
5054
const resolve = memoize(origResolve);
5155

5256
export type AddOptions = {
@@ -133,6 +137,8 @@ export async function addCucumberPreprocessorPlugin(
133137
const tags = getTags(config.env);
134138

135139
if (tags !== null && preprocessor.filterSpecs) {
140+
debug(`Filtering specs using expression ${inspect(tags)}`);
141+
136142
const node = parse(tags);
137143

138144
const testFiles = getTestFiles(
@@ -176,6 +182,8 @@ export async function addCucumberPreprocessorPlugin(
176182
);
177183
});
178184

185+
debug(`Resolved specs ${inspect(testFiles)}`);
186+
179187
const propertyName = "specPattern" in config ? "specPattern" : "testFiles";
180188

181189
/**

0 commit comments

Comments
 (0)