[Vuejs]-Error: Error: the "filename" option is required to use includes and extends with "relative" paths

2๐Ÿ‘

โœ…

I think you should specify baseDir to be able to use include\extends with jest testing and include files in your tempaltes like include /HelloWorld.pug.

And in jest config it should be:

'vue-jest': {
  pug: {
    baseDir: path.join(__dirname, 'my/folder/with/views');
  }
 },

P.S. Also your webpack configuration of pug-loader should be changed (I think root property of pug-loader options).

๐Ÿ‘คMax Sinev

0๐Ÿ‘

You need to set vue-jest params under global prop in jest config:

"jest": {
  "globals": {
    "vue-jest": {
      "pug": {
        "basedir": "./"
      }
    }
  },
๐Ÿ‘คArtemKha

Leave a comment