avoid unnecessary nested ifs
Showing
2 changed files
with
2 additions
and
5 deletions
... | @@ -21,11 +21,9 @@ function checkSelfTest(tests) { | ... | @@ -21,11 +21,9 @@ function checkSelfTest(tests) { |
21 | var isCasperTest = false; | 21 | var isCasperTest = false; |
22 | tests.forEach(function(test) { | 22 | tests.forEach(function(test) { |
23 | var testDir = fs.absolute(fs.dirname(test)); | 23 | var testDir = fs.absolute(fs.dirname(test)); |
24 | if (fs.isDirectory(testDir)) { | 24 | if (fs.isDirectory(testDir) && fs.exists(fs.pathJoin(testDir, '.casper'))) { |
25 | if (fs.exists(fs.pathJoin(testDir, '.casper'))) { | ||
26 | isCasperTest = true; | 25 | isCasperTest = true; |
27 | } | 26 | } |
28 | } | ||
29 | }); | 27 | }); |
30 | return isCasperTest; | 28 | return isCasperTest; |
31 | } | 29 | } |
... | @@ -89,7 +87,6 @@ this.loadIncludes.forEach(function(include){ | ... | @@ -89,7 +87,6 @@ this.loadIncludes.forEach(function(include){ |
89 | }).filter(function(file) { | 87 | }).filter(function(file) { |
90 | return utils.isString(file); | 88 | return utils.isString(file); |
91 | }); | 89 | }); |
92 | |||
93 | casper.test.loadIncludes[include] = utils.unique(container); | 90 | casper.test.loadIncludes[include] = utils.unique(container); |
94 | } | 91 | } |
95 | }); | 92 | }); | ... | ... |
-
Please register or sign in to post a comment