File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -644,8 +644,16 @@ class TapParser extends Transform {
644644 }
645645
646646 const planEnd = this . #next( ) ;
647- if ( planEnd ? .kind !== TokenKind . NUMERIC ) {
647+ if ( ! planEnd || planEnd . kind !== TokenKind . NUMERIC ) {
648648 this . #error( 'Expected a plan end count' ) ;
649+ const node = {
650+ kind : TokenKind . UNKNOWN ,
651+ node : {
652+ value : this . #currentChunkAsString,
653+ } ,
654+ } ;
655+
656+ return node ;
649657 }
650658
651659 const plan = {
Original file line number Diff line number Diff line change @@ -17,6 +17,28 @@ const cases = [
1717 } ,
1818 ] ,
1919 } ,
20+ {
21+ input : '123' ,
22+ expected : [
23+ {
24+ kind : 'Unknown' ,
25+ node : { value : '123' } ,
26+ nesting : 0 ,
27+ lexeme : '123' ,
28+ } ,
29+ ] ,
30+ } ,
31+ {
32+ input : '# 123' ,
33+ expected : [
34+ {
35+ kind : 'Comment' ,
36+ node : { comment : '123' } ,
37+ nesting : 0 ,
38+ lexeme : '# 123' ,
39+ } ,
40+ ] ,
41+ } ,
2042 {
2143 input : 'invalid tap' ,
2244 expected : [
You can’t perform that action at this time.
0 commit comments