Coder Social home page Coder Social logo

vueusetests's Introduction

Vue.js 学习之测试篇

Vue.js 学习之测试篇

关于

该工程是学习 Vue.js 工程测试的一次实战,涵盖了单元测试和自动化测试的配置和应用。关于本项目的教程总结,可参考:URL

常见问题

Error in config.errorHandler: "ReferenceError: Can't find variable: Promise"'

出现该问题是因为 Karma 配置的浏览器是 PhantomJS,并不支持Promise 函数。

解决方法

  • 安装 es6-promise:$ npm install es6-promise --save--dev
  • 在 test/unit/index.js 中引入 es6-promise,并执行 polyfill 方法

修改后的 test/unit/index.js 大致如:

import Vue from 'vue'
import Promise from 'es6-promise'

Promise.polyfill()

Vue.config.productionTip = false

// 略···

vueusetests's People

Contributors

djyuning avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.