Skip to content

Commit

Permalink
Merge 7f547e7 into 22a0f69
Browse files Browse the repository at this point in the history
  • Loading branch information
fadc80 committed Jun 4, 2019
2 parents 22a0f69 + 7f547e7 commit d42c262
Show file tree
Hide file tree
Showing 4 changed files with 1,306 additions and 1,377 deletions.
12 changes: 6 additions & 6 deletions lib/path-finder.js
Expand Up @@ -50,21 +50,21 @@ function exist(paths, path, describe, it) {
}

function existDescribe(paths, path, describe) {
return paths[path].describe.find(element => describe.startsWith(element) ||
escapeQuotes(describe).startsWith(element)) !== undefined;
return paths[path].describe.find(element =>
describe.startsWith(removeEscapedQuotes(element)));
}

function existIt(paths, path, it) {
return paths[path].it.find(element => it.startsWith(element) ||
escapeQuotes(it).startsWith(element)) !== undefined;
return paths[path].it.find(element =>
it.startsWith(removeEscapedQuotes(element)));
}

function regexPattern() {
return /((describe)|(it))\s*\(\s*((?<![\\])[\`\'\"])((?:.(?!(?<![\\])\4))*.?)\4/gi;
}

function escapeQuotes(str) {
return str.replace(/\\([\s\S])|("|')/g,"\\$1$2");
function removeEscapedQuotes(str) {
return str.replace(/(?:\\|\\\\)((")|(')|(`))/g,"$1");
}

function removeComments(data) {
Expand Down

0 comments on commit d42c262

Please sign in to comment.