ui.js 877 B

12345678910111213141516171819202122232425262728293031
  1. module.exports = api => {
  2. api.describeTask({
  3. match: /vue-cli-service test:unit/,
  4. description: 'org.vue.jest.tasks.test.description',
  5. link: 'https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-unit-jest#injected-commands',
  6. prompts: [
  7. {
  8. name: 'watch',
  9. type: 'confirm',
  10. description: 'org.vue.jest.tasks.test.watch'
  11. },
  12. {
  13. name: 'notify',
  14. type: 'confirm',
  15. description: 'org.vue.jest.tasks.test.notify',
  16. when: answers => answers.watch
  17. },
  18. {
  19. name: 'update',
  20. type: 'confirm',
  21. description: 'org.vue.jest.tasks.test.update'
  22. }
  23. ],
  24. onBeforeRun: ({ answers, args }) => {
  25. if (answers.watch) args.push('--watch')
  26. if (answers.notify) args.push('--notify')
  27. if (answers.update) args.push('--updateSnapshot')
  28. }
  29. })
  30. }