From de692e0113511e9d8c5caf2bc8b347d5ef878646 Mon Sep 17 00:00:00 2001 From: gearsdigital Date: Sun, 24 Nov 2019 11:28:13 +0100 Subject: [PATCH] fix(path-finder): handle skipped test correctly Closes #23 --- lib/path-finder.js | 9 +++++---- spec/lib/path-finder.spec.js | 32 ++++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 8 deletions(-) diff --git a/lib/path-finder.js b/lib/path-finder.js index fa55cd7..1ad7e2c 100644 --- a/lib/path-finder.js +++ b/lib/path-finder.js @@ -25,10 +25,10 @@ function parseTestFile(paths, path, data) { if (paths[path] == undefined) { paths[path] = { describe: [], it: [] }; } - if (type === 'describe') { + if (type.includes("describe")) { paths[path].describe.push(text); } - if (type === 'it') { + if (type.includes("it")) { paths[path].it.push(text); } } @@ -60,7 +60,8 @@ function existIt(paths, path, it) { } function regexPattern() { - return /((describe)|(it))\s*\(\s*((?