Bubbit / wct-istanbub

11 stars 5 forks source link

TypeError: Path must be a string. Received undefined #5

Closed MattAlex151 closed 6 years ago

MattAlex151 commented 6 years ago

Hi Bubbit, Using wct 6.4.0 and istanbub 0.11.0 I'm receiving the below error. I spent a little while trying to find the source, as well as trying alternative code coverage tools for WCT with no success. I'm wondering if I'm missing something obvious in this error and if you could point me in the right direction as your plugin seems to be the most maintained / recent available. Thanks for your time and let me know if I could provide you with more information.


> proto@1.0.0 test /project
> $(npm bin)/wct -l chrome --expanded 

Installing and starting Selenium server for local browsers
Selenium server running on port 45213
no bower.json found, defaulting to packageName=ui
ERROR: Server failed to start: TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.basename (path.js:1376:5)
    at getPackageName (/project/node_modules/wct-istanbub/lib/middleware.js:94:25)
    at Object.coverageMiddleware [as middleware] (/project/node_modules/wct-istanbub/lib/middleware.js:105:20)
    at /project/node_modules/wct-istanbub/lib/plugin.js:43:27
    at Promise (/project/node_modules/web-component-tester/runner/context.js:107:42)
    at Promise (<anonymous>)
    at hookToPromise (/project/node_modules/web-component-tester/runner/context.js:106:24)
    at Context.<anonymous> (/project/node_modules/web-component-tester/runner/context.js:124:27)
    at Generator.next (<anonymous>)

Error: TypeError: Path must be a string. Received undefined

wct.conf.js: (Note I've tried w/ both the "exclude" block, and without.)

var path = require('path');

module.exports = {
  suites: [
    "test/"
  ],
  plugins: {
    local: {
      browserOptions: {
        chrome: [
          "headless",
          "disable-gpu"
        ]
      }
    },
    istanbub: {
      dir: "./coverage",
      reporters: ["text-summary", "lcov"],
      include: [
        "**/*.html"
      ],
      exclude: [
        "**/test/**"
      ]
    }
  }
}

For what it's worth, if I simply remove the instanbub section from wct.conf.js then my tests run fine no problem without any changes to paths or otherwise.

Bubbit commented 6 years ago

We just released version 0.1.2 with a small fix, could you see if this one solves your use-case as I'm not 100% sure I have the same folder structure in the application I used to test this fix ^^

MattAlex151 commented 6 years ago

Works great! Thanks so much! Glad it was a simple fix.