unit test mocha Visual Studio Code describe is not defined

Finally!!! After a long search and reading some tutorials and comments I found the solution: the problem was with the config.

Open the test config file and delete the following lines:

            "-u", <<<< delete this line
            "tdd", <<<< delete this line

launch.js

        "version": "0.2.0",
        "configurations": [
            {
                "type": "node",
                "request": "launch",
                "name": "Mocha Tests",
                "program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
                "args": [
                    "--require", 
                    "ts-node/register",
                    "-u", <<<< delete this line
                    "tdd", <<<< delete this line
                    "--timeout",
                    "999999",
                    "--colors",
                    "${workspaceFolder}/tests/**/*.spec.ts"
                ],
                "internalConsoleOptions": "openOnSessionStart"
            },

Run the test again and it will work.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)