scottcorgan / tap-out

A different tap parser
MIT License
23 stars 28 forks source link

TypeError: Cannot read property 'replace' of undefined #33

Closed ChocPanda closed 4 years ago

ChocPanda commented 5 years ago

I am getting the following error in my CI pipeline. I'm not yet sure of the cause but unfortunately the below error is preventing me from creating a proper test report.

/home/circleci/project/node_modules/trim/index.js:5
  return str.replace(/^\s*|\s*$/g, '');
             ^

TypeError: Cannot read property 'replace' of undefined
    at trim (/home/circleci/project/node_modules/trim/index.js:5:14)
    at Parser._handleError (/home/circleci/project/node_modules/tap-out/index.js:189:14)
    at Parser.handleLine (/home/circleci/project/node_modules/tap-out/index.js:48:8)
    at Stream.<anonymous> (/home/circleci/project/node_modules/tap-out/index.js:256:14)
    at Stream.emit (events.js:200:13)
    at drain (/home/circleci/project/node_modules/through/index.js:36:16)
    at Stream.stream.queue.stream.push (/home/circleci/project/node_modules/through/index.js:45:5)
    at emit (/home/circleci/project/node_modules/split/index.js:37:14)
    at next (/home/circleci/project/node_modules/split/index.js:49:7)
    at Stream.<anonymous> (/home/circleci/project/node_modules/split/index.js:54:5)

I saw that in line 151 of the index file you account for the possibility that m may only have a single member so I have simply repeated the logic below in line 180 to prevent the error.

I also noted that you appeared to be using a rather old library for trimming your strings, as this functionality is now a member of the String type I took the liberty of updating that as well, I hope this is okay

ChocPanda commented 5 years ago

@scottcorgan Any chance you could take a look at this?

3cp commented 4 years ago

@scottcorgan please have a look of this fix.

ChocPanda commented 4 years ago

@scottcorgan Can you please review this

Sceat commented 4 years ago

@ChocPanda this is bugging me since quite some time as tap-out is a dead repo, can you publish your fork to npm, i will use it in https://github.com/Sceat/tap-spec-emoji

ChocPanda commented 4 years ago

Sure, I'll post a link here when I'm done

ChocPanda commented 4 years ago

@Sceat @3cp I have published my fork here to NPM here

Sceat commented 4 years ago

now using it in https://github.com/Sceat/tap-spec-emoji

Sceat commented 4 years ago

working good with the at in @hydre/doubt :+1:

image