Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

476
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!