vscode-mocha-test-adapter | Mocha Test Adapter for the VS Code Test Explorer | Unit Testing library

 by   hbenl TypeScript Version: 2.11.1 License: MIT

kandi X-RAY | vscode-mocha-test-adapter Summary

kandi X-RAY | vscode-mocha-test-adapter Summary

vscode-mocha-test-adapter is a TypeScript library typically used in Testing, Unit Testing, Visual Studio Code applications. vscode-mocha-test-adapter has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Mocha Test Adapter for the VS Code Test Explorer
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              vscode-mocha-test-adapter has a low active ecosystem.
              It has 84 star(s) with 28 fork(s). There are 2 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 67 open issues and 148 have been closed. On average issues are closed in 98 days. There are 7 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of vscode-mocha-test-adapter is 2.11.1

            kandi-Quality Quality

              vscode-mocha-test-adapter has 0 bugs and 0 code smells.

            kandi-Security Security

              vscode-mocha-test-adapter has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              vscode-mocha-test-adapter code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              vscode-mocha-test-adapter is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              vscode-mocha-test-adapter releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of vscode-mocha-test-adapter
            Get all kandi verified functions for this library.

            vscode-mocha-test-adapter Key Features

            No Key Features are available at this moment for vscode-mocha-test-adapter.

            vscode-mocha-test-adapter Examples and Code Snippets

            No Code Snippets are available at this moment for vscode-mocha-test-adapter.

            Community Discussions

            QUESTION

            when transpiling mocha test using ts-node i cannot find module 'tsconfig/register'
            Asked 2020-Oct-28 at 03:13

            I have run both npm i ts-node and npm i ts-node --save-dev with no changes. ts-node works fine when I run it from the command line, but for some reason I cannot run mocha tests through test explorer. I get the error below:

            error:

            ...

            ANSWER

            Answered 2020-Oct-28 at 03:13

            Turns out none of the package.json config options were working for me. I wound up implementing a .mocharc.json on the same level as my package.json which worked perfectly.

            Example from this github repo (with more examples) copied here for posterity.

            Source https://stackoverflow.com/questions/64562882

            QUESTION

            How can I add testing, to an existing Typescript project, and get it to show up in Text Explorer?
            Asked 2020-Mar-20 at 23:42

            I've been playing with a Typescript project that doesn't yet have tests written. (Commit Adding Tests)

            I've tried 2 different methods of adding tests written in Typescript.

            1. launch.json
            2. package.json

            Both of these approaches currently work, and are able to be debugged via the normal task launch / debugging.

            However I've tried 2 different VSCode Extensions, to add support to the test explorer to run these tests, to get better GUI and automatic feedback, visualize coverage etc.

            Mocha-Sidebar and Mocha test Explorer

            Neither of them have picked up the tests that I have written using the default configuration. And both of them have sparse documentation on how to setup Tests written in Typescript

            All blog posts found online, currently seem to be relevant from testing from the command line / task launching.

            How can Mocha-Sidebar or Mocha-Test-Explorer or Some other Test Explorer Adapter be configured to work with the tests in that commit.

            And is it possible without committing further configuration files to the git repository, and have someone fork the project and be able to run the tests.

            e.g. BDD style, inside test folder, named like test/hello-world.test.ts written in Typescript, With full debugging support.

            ...

            ANSWER

            Answered 2020-Mar-20 at 23:42

            Invoking Mocha

            When you invoke mocha via command line, package.json, or launch.json, you provide mocha with two critical pieces of information:

            • A glob pattern specifying where the test files are.
            • A --require flag, specifying any additional modules to load.

            When using one or both of the VSCode extensions mentioned, the extension(s) needs to be provided these two key pieces of information.

            Configuring Extensions

            These two extensions have a lot of overlap, so I'd recommend using one or the other. My personal preference is Mocha Test Explorer. I found the Mocha Sidebar was excessively slow in running larger test suites. At any rate, they are both configured a very similar fashion:

            Mocha Explorer

            Tell it where the tests are, and to use ts-node for on-the-fly compilation. These settings go in settings.json, at either the user level or the project level.

            Source https://stackoverflow.com/questions/60745530

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install vscode-mocha-test-adapter

            Install the extension and restart VS Code
            Put your Mocha command line options (if you have any) in a mocha configuration file (either a .mocharc.* file or a mocha property in your package.json or a mocha.opts file) or VS Code's settings (see below)
            Open the Test view
            Run / Debug your tests using the / icons in the Test Explorer or the CodeLenses in your test file

            Support

            If the Test view doesn't show your tests or anything else doesn't work as expected, you can turn on diagnostic logging using one of the following configuration options (note: in multi-root workspaces, these options are always taken from the first workspace folder):. Note that the logs usually contain a lot of stacktraces, but if a stacktrace starts with "[INFO] Worker: Looking for <some path> in Error", then that stacktrace doesn't mean that something went wrong: such stacktraces are used to find the location of a test in a file. There is a bug in Node 10.6.0 - 10.9.0 that breaks this adapter. If you're using a version of Node affected by this bug, add "mochaExplorer.nodePath": null to your configuration as a workaround. If you think you've found a bug, please file a bug report and attach the diagnostic logs.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • npm

            npm i vscode-mocha-test-adapter

          • CLONE
          • HTTPS

            https://github.com/hbenl/vscode-mocha-test-adapter.git

          • CLI

            gh repo clone hbenl/vscode-mocha-test-adapter

          • sshUrl

            git@github.com:hbenl/vscode-mocha-test-adapter.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link