$ vue-cli-service test:unit
WEBPACK Compiling...
Download the Vue Devtools extension for a better development experience:
https://github.com/vuejs/vue-devtools
You are running Vue in development mode.
Make sure to turn on production mode when deploying for production.
See more tips at https://vuejs.org/guide/deployment.html
DONE Compiled successfully in 3044ms
WEBPACK Compiled successfully in 3044ms
MOCHA Testing...
Application launch
(node:1112) UnhandledPromiseRejectionWarning: Error: ChromeDriver did not start within 5000ms
at /Users/kerwin/Program/vue/tddvue/node_modules/spectron/lib/chrome-driver.js:63:25
at Request._callback (/Users/kerwin/Program/vue/tddvue/node_modules/spectron/lib/chrome-driver.js:121:23)
at self.callback (/Users/kerwin/Program/vue/tddvue/node_modules/request/request.js:185:22)
at Request.emit (events.js:198:13)
at Request.EventEmitter.emit (domain.js:448:20)
at Request.onRequestError (/Users/kerwin/Program/vue/tddvue/node_modules/request/request.js:881:8)
at ClientRequest.emit (events.js:198:13)
at ClientRequest.EventEmitter.emit (domain.js:448:20)
at Socket.socketErrorListener (_http_client.js:392:9)
at Socket.emit (events.js:198:13)
at Socket.EventEmitter.emit (domain.js:448:20)
at emitErrorNT (internal/streams/destroy.js:91:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
(node:1112) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:1112) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
1) "before each" hook for "opens a window"
ERROR mochapack exited with code 1.
HelloWorld.vue
✓ renders props.msg when passed
1 passing (30s)
1 failing
1) Application launch
"before each" hook for "opens a window":
Error: Timeout of 30000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/kerwin/Program/vue/tddvue/dist/js/main.js)
MOCHA Tests completed with 1 failure(s)
Total task duration: 39.28s
解决方法:
$ npm install --save-dev spectron
网友评论