Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/385.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
Javascript SyntaxError:意外标记<;当尝试使用AVA进行测试时_Javascript_Vue.js_Nuxt.js_Ava - Fatal编程技术网

Javascript SyntaxError:意外标记<;当尝试使用AVA进行测试时

Javascript SyntaxError:意外标记<;当尝试使用AVA进行测试时,javascript,vue.js,nuxt.js,ava,Javascript,Vue.js,Nuxt.js,Ava,我最初的问题出现在基于nuxt的项目中。为了解决这个问题,我通过vue cli设置了一个新项目,并通过npm再次安装了AVA,但它没有改变任何东西。我在github上发现了这个问题(),其中的一条评论(Atinux的,3月25日)似乎回答了我的问题,但当我尝试转到上面提到的链接时,我得到了404。这篇文章的作者说,他从来并没有想过使用完整的路径,但我真的不明白他的确切意思 我还尝试了几种不同的组件语法,但据我所知,问题出在AVA设置中,因为问题出在第一个“=4.0.0”, “npm”:“>=3.

我最初的问题出现在基于nuxt的项目中。为了解决这个问题,我通过vue cli设置了一个新项目,并通过npm再次安装了AVA,但它没有改变任何东西。我在github上发现了这个问题(),其中的一条评论(Atinux的,3月25日)似乎回答了我的问题,但当我尝试转到上面提到的链接时,我得到了404。这篇文章的作者说,他从来并没有想过使用完整的路径,但我真的不明白他的确切意思

我还尝试了几种不同的组件语法,但据我所知,问题出在AVA设置中,因为问题出在第一个“=4.0.0”, “npm”:“>=3.0.0” }, “浏览者”:[ "> 1%", “最后两个版本”,
“不是ie我在您的配置中没有看到任何告诉测试进程如何加载
.vue
文件的内容。应该有更多信息

    <template>
  <div class="hello">
    <h1>{{ msg }}</h1>
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Vue app'
    }
  }
}
</script>
import test from 'ava'
import HelloWorld from './HelloWorld.vue'

test('message is Hello World', t => {
  t.is(HelloWorld.name, 'HelloWorld')
})

test('message is Hello World', t => {
  t.is(HelloWorld.$data.msg, 'Vue app')
})
{
  "name": "ava-testing",
  "version": "1.0.0",
  "description": "lol",
  "author": "SP",
  "private": true,
  "scripts": {
    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "start": "npm run dev",
    "lint": "eslint --ext .js,.vue src",
    "build": "node build/build.js",
    "test": "ava"
  },
  "dependencies": {
    "vue": "^2.5.2"
  },
  "devDependencies": {
    "autoprefixer": "^7.1.2",
    "ava": "^0.24.0",
    "babel-core": "^6.22.1",
    "babel-eslint": "^7.1.1",
    "babel-helper-vue-jsx-merge-props": "^2.0.3",
    "babel-loader": "^7.1.1",
    "babel-plugin-syntax-jsx": "^6.18.0",
    "babel-plugin-transform-runtime": "^6.22.0",
    "babel-plugin-transform-vue-jsx": "^3.5.0",
    "babel-preset-env": "^1.3.2",
    "babel-preset-stage-2": "^6.22.0",
    "chalk": "^2.0.1",
    "copy-webpack-plugin": "^4.0.1",
    "css-loader": "^0.28.0",
    "eslint": "^3.19.0",
    "eslint-config-standard": "^10.2.1",
    "eslint-friendly-formatter": "^3.0.0",
    "eslint-loader": "^1.7.1",
    "eslint-plugin-html": "^3.0.0",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-node": "^5.2.0",
    "eslint-plugin-promise": "^3.4.0",
    "eslint-plugin-standard": "^3.0.1",
    "extract-text-webpack-plugin": "^3.0.0",
    "file-loader": "^1.1.4",
    "friendly-errors-webpack-plugin": "^1.6.1",
    "html-webpack-plugin": "^2.30.1",
    "node-notifier": "^5.1.2",
    "optimize-css-assets-webpack-plugin": "^3.2.0",
    "ora": "^1.2.0",
    "portfinder": "^1.0.13",
    "postcss-import": "^11.0.0",
    "postcss-loader": "^2.0.8",
    "rimraf": "^2.6.0",
    "semver": "^5.3.0",
    "shelljs": "^0.7.6",
    "uglifyjs-webpack-plugin": "^1.1.1",
    "url-loader": "^0.5.8",
    "vue-loader": "^13.3.0",
    "vue-style-loader": "^3.0.1",
    "vue-template-compiler": "^2.5.2",
    "webpack": "^3.6.0",
    "webpack-bundle-analyzer": "^2.9.0",
    "webpack-dev-server": "^2.9.1",
    "webpack-merge": "^4.1.0"
  },
  "engines": {
    "node": ">= 4.0.0",
    "npm": ">= 3.0.0"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
}