tapjs / tap-parser

parse the test anything protocol
121 stars 35 forks source link

Directives not matched correctly #66

Closed Munter closed 4 years ago

Munter commented 5 years ago

I have a case there my test name contains an #, which tap-parser parses as if the directive starts at this first #. I have a case where that logic fails because my directive comes later.

Example:

ok 8050 index.html --> code.html#line12 # SKIP

The TAP specification only ever mentions SKIP and TODO directives as having this exact syntax # SKIP or # TODO, so a # followed by a space, followed by the directive.

tap-parser doesn't match the directive name in that exact way. In https://github.com/tapjs/tap-parser/blob/master/index.js#L72 my example ends up as 'line12 # SKIP' in the rest variable, which then gets sent into directive detection. But the directive detection only looks for skip and todo at the very start of the string and thus never detects my directive