tape: number of tests do not match up

tape -- tests/*.js core/tests/*.js plugins/*/tests/*.js
# tests 115

and

tape -- tests/*.js
# tests 34

tape -- core/tests/*.js
# tests 89

tape -- plugins/*/tests/*.js
# tests 81

34 + 89 + 81 = 204

115 != 204 WTF?

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 42 (1 by maintainers)

Most upvoted comments

I’m going to create a test/bin.js file, and see if I can write some test conditions that should pass, but fail, and then go from there. I suspect that we’ll need to add {--:true} to the parser.

I don’t think that should be a problem. However, they definitely need to be quoted.

I think I’m going to close this for now.

If someone wants to try a PR that makes unquoted options work, that’d be very interesting to consider.

I’ve just found that I’m unable to test more than one dir using glob expansion, and I think it’s another indicator of this issue.

For example:

tape ./test/**/*.spec.js is the command I’m running, against:

-/test
|- example.spec.js
|---/core
       |-componentA.spec.js
       |-componentB.spec.js
       |--/sub-core
             |- componentC.spec.js

Only tests from the /core folder however, were run.

I created a test glob.js file, and gave it the same ./test/**/*.spec.js pattern, and it logged out all 4 files.

ar glob = require("glob");

glob("./test/**/*.spec.js", function(er, files){

    files.forEach(function(file){
        process.stdout.write(`matched file: ${file}\r\n`);  
    });
});

Here’s the commit from my project demoing this.

I think the problem has to be related to how the results from glob are passed to tap?