Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Webpack 如何使用pug模板为测试vue组件设置网页包_Webpack_Vue Test Utils_Pug Loader - Fatal编程技术网

Webpack 如何使用pug模板为测试vue组件设置网页包

Webpack 如何使用pug模板为测试vue组件设置网页包,webpack,vue-test-utils,pug-loader,Webpack,Vue Test Utils,Pug Loader,我正试图使用官方文档为vue组件编写一个测试代码,该测试使用lang=“pug”模板 我做错了什么 谢谢 错误: iMac-Dmitriy:template-project dmitriy$ npm run test > Site@1.0.0 test /Library/WebServer/projects/template-project > mochapack --webpack-config webpack.config.js --require test/setup.js

我正试图使用官方文档为vue组件编写一个测试代码,该测试使用lang=“pug”模板

我做错了什么

谢谢

错误:

iMac-Dmitriy:template-project dmitriy$ npm run test

> Site@1.0.0 test /Library/WebServer/projects/template-project
> mochapack --webpack-config webpack.config.js --require test/setup.js test/**/*.spec.js

 WEBPACK  Compiling...

  [=========================] 100% (completed)

 WEBPACK  Failed to compile with 1 error(s)

Error in ./src/components/ui/Input.vue

  Module parse failed: Unexpected token (1:0)
  You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
  > <template lang="pug">
  |     include ../../tools/mixins.pug
  |     +b.LABEL.input(

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Site@1.0.0 test: `mochapack --webpack-config webpack.config.js --require test/setup.js test/**/*.spec.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the Site@1.0.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/dmitriy/.npm/_logs/2020-11-04T17_10_06_692Z-debug.log
iMac dmitry:template项目dmitry$npm运行测试
> Site@1.0.0测试/库/Web服务器/项目/模板项目
>mochapack--webpack config webpack.config.js--require test/setup.js test/***.spec.js
网页包编译。。。
[============================]100%(已完成)
无法编译网页包,出现1个错误
./src/components/ui/Input.vue中出错
模块分析失败:意外令牌(1:0)
您可能需要适当的加载程序来处理此文件类型,目前没有配置加载程序来处理此文件。看见https://webpack.js.org/concepts#loaders
> 
|包括.././tools/mixins.pug
|+b.LABEL.input(
npm错误!代码错误周期
npm错误!错误1
npm错误!Site@1.0.0test:`mochapack--webpack config webpack.config.js--require test/setup.js test/***.spec.js`
npm错误!退出状态1
npm错误!
npm ERR!在以下位置失败:Site@1.0.0测试脚本。
npm错误!这可能不是npm的问题。上面可能还有其他日志输出。
npm ERR!此运行的完整日志可在以下位置找到:
npm ERR!/Users/dmitry/.npm/_logs/2020-11-04T17_10_06_692; z-debug.log
组成部分:

包括.././tools/mixins.pug用于插件bemto

<template lang="pug">
    include ../../tools/mixins.pug
    +b.LABEL.input(
        :class="{'error': error}"
    )
        +e.INPUT.value(
            :type="type"
            :value="value"
            :placeholder="placeholder"
            v-on:focus="$emit('focus')"
            v-on:blur="$emit('blur')"
            v-on:input="onInput"
        )
</template>

包括.././tools/mixins.pug
+b、 LABEL.input(
:class=“{'error':error}”
)
+e、 输入值(
:type=“type”
:value=“value”
:placeholder=“placeholder”
v-on:focus=“$emit('focus')”
v-on:blur=“$emit('blur')”
v-on:input=“onInput”
)