Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run specific tests using Jasmine and Visual studio code?

I have started using Jasmine (not Karma yet) with Visual Studio Code. Works nicely with the following config:

{
"version": "0.2.0",
"configurations": [
    {
        "name": "jasmine",
        "type": "node",
        "request": "launch",
        "program": "${workspaceRoot}/node_modules/jasmine/bin/jasmine.js",
        "stopOnEntry": false,
        "args": [],
        "cwd": "${workspaceRoot}",
        "runtimeArgs": [
            "--nolazy"
        ],
        "env": {
            "NODE_ENV": "development"
        }
    }
  ]
}

Now my tests are building up I wanted to know if there was a way to just run a specific test or a tests within a specific file? At the moment all my tests are running which take a while.

like image 861
JD. Avatar asked Mar 05 '26 07:03

JD.


1 Answers

The same way as from the cli would be the simplest option (since Jasmine 2.1: fit, fdescribe)

See How do I focus on one spec in jasmine.js?

like image 85
Shmee007 Avatar answered Mar 06 '26 20:03

Shmee007