Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

349
Visualizações
VueJS Unit testing - I cannot run my tests. "Command 'test/unit' does not exists"

I'm trying to setup Unit Tests with VueJS 3. Reading the docs of Vue 3, I Installed test-utils 2.0

My package.json file looks like this :

{
  "name": "testsUnitVue",
  "version": "0.1.0",
  "private": true,
  "scripts": {

    ...

    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "test:unit": "vue-cli-service test:unit",
    "lint": "vue-cli-service lint",

    ...

  },
  "dependencies": {
    ...
  },
  "devDependencies": {

    ...

    "@vue/test-utils": "^2.0.0-rc.21",

    ...

  }
}

I try to run my the tests with:

npm run test:unit

But I've the following error message:

> testsUnitVue@0.1.0 test:unit
> vue-cli-service test:unit

 ERROR  command "test:unit" does not exist.

I've a similar result with yarn command. How can I solve this?

PS: If you need more informations, then just leave a comment :)

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The @vue/test-utils does not provide the unit:test subcommand of vue-cli-service. Those are available when using one of the following plugins:

  • https://cli.vuejs.org/core-plugins/unit-jest.html
  • https://cli.vuejs.org/core-plugins/unit-mocha.html

For instructions on how to install those see: https://cli.vuejs.org/guide/plugins-and-presets.html#installing-plugins-in-an-existing-project

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda