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

477
Visualizações
Odin project and running jest on Windows : how to run single test in VS code

I am working on the Odin project and I have arrived at the test driven part. I am on windows, installed everything as instructed and I use VS code as my IDE.

Now, I use VS code debugger to run the tests i.e. for the first case hello world I run the debugger on the helloWorld.spec.js file.

The tests runs as expected ... but in fact it runs all the 14 tests not only the one I am working on. As I am curious to understand how it works I would like to succeed running only the test I am working on.

I searched on Google but I couldn't find an answer that make my quest a success.

Do you know how to achieve this ? My configuration is shown herebelow.

  1. First, my structure :

directory structure

  1. Then, my debug config file
     "version": "1.0.0",
     "configurations": [
       {
         "type": "node",
         "request": "launch",
         "name": "Jest: current file",
         //"env": { "NODE_ENV": "test" },
         "program": "${workspaceFolder}/node_modules/.bin/jest",
         "args": ["--runInBand", "--no-cache", "--watchAll=false"],
         "console": "integratedTerminal",
         "disableOptimisticBPs": true,
         "windows": {
           "program": "${workspaceFolder}/node_modules/jest/bin/jest"
         }
       }
     ]
   }
  1. I also installed jest extension in VS code, in the hope to solve my issues and here are the settings for that extension :
    "jest.autoRun": {
        "watch": false,
        "onSave": "test-src-file",
        "onStartup": [
          "all-tests"
        ]
      },
      "jest.debugCodeLens.showWhenTestStateIn": [
        "pass",
        "fail",
        "unknown"
      ],
      "jest.coverageFormatter": "GutterFormatter",
about 4 years ago · Santiago Gelvez
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