From 7eb50152b00f3c226cad0f10203d22a813e50b2b Mon Sep 17 00:00:00 2001 From: Mateusz Podlasin Date: Sun, 5 Feb 2017 14:29:44 +0100 Subject: [PATCH] chore(dangerfile): fix test for hot and cold usages without types Fix logic in test for files which use hot and cold helpers but do not provide type declarations for them, so that files that do not use hot and cold helpers at all would not count as false positives. --- dangerfile.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dangerfile.js b/dangerfile.js index 5c0335b334..499a447201 100644 --- a/dangerfile.js +++ b/dangerfile.js @@ -40,10 +40,10 @@ if (testFilesIncludeExclusion.length > 0) { var testFilesMissingTypes = modifiedSpecFiles.reduce(function (acc, value) { var content = fs.readFileSync(value).toString(); - var hotFnMatches = content.match(hotMatch) && content.match(hotSignatureMatch); - var coldFnMatches = content.match(coldMatch) && content.match(coldSignatureMatch); + var hotFnMatchesWithoutTypes = content.match(hotMatch) && !content.match(hotSignatureMatch); + var coldFnMatchesWithoutTypes = content.match(coldMatch) && !content.match(coldSignatureMatch); - if (!hotFnMatches || !coldFnMatches) { + if (hotFnMatchesWithoutTypes || coldFnMatchesWithoutTypes) { acc.push(path.basename(value)); }