2018年7月8日 星期日

[Vue-cli]Test

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run unit tests
npm run unit

# run e2e tests
npm run e2e

# run all tests
npm test
D:\測試\0709\a0709>yarn run test
yarn run v1.7.0
warning ..\package.json: No license field
$ npm run unit && npm run e2e

> a0709@1.0.0 unit D:\測試\0709\a0709
> jest --config test/unit/jest.conf.js --coverage

● Deprecation Warning:

  Option "mapCoverage" has been removed, as it's no longer necessary.

  Please update your configuration.

  Configuration Documentation:
  https://facebook.github.io/jest/docs/configuration.html

 PASS  test\unit\specs\HelloWorld.spec.js
  HelloWorld.vue
    √ should render correct contents (43ms)

----------------|----------|----------|----------|----------|-------------------|
File            |  % Stmts | % Branch |  % Funcs |  % Lines | Uncovered Line #s |
----------------|----------|----------|----------|----------|-------------------|
All files       |      100 |      100 |      100 |      100 |                   |
 HelloWorld.vue |      100 |      100 |      100 |      100 |                   |
----------------|----------|----------|----------|----------|-------------------|
Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        7.333s
Ran all test suites.

> a0709@1.0.0 e2e D:\測試\0709\a0709
> node test/e2e/runner.js

Starting selenium server... started - PID:  8372

[Test] Test Suite
=====================

Running:  default e2e tests
 √ Element <#app> was visible after 59 milliseconds.
 √ Testing if element <.hello> is present.
 √ Testing if element <h1> contains text: "Welcome to Your Vue.js App".
 √ Testing if element <img> has count: 1

OK. 4 assertions passed. (9.387s)

Done in 36.55s.

沒有留言:

張貼留言