mocha-sidebar | Mocha side bar viewer that allows you to run | Runtime Evironment library
kandi X-RAY | mocha-sidebar Summary
kandi X-RAY | mocha-sidebar Summary
Mocha side bar viewer that allows you to run Mocha tests from side bar menu and view results can run each level hierarchy from all tests to a single test(and each describer of course)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Create a child process
- Initialize a reporter .
- Search for node paths
- Bootstrap coverage providers .
- Detects mutations in a code block .
- Formats an argument name to a test case
- Determines whether two arrays are equal .
- Determines whether a given token is valid .
- Convert a suite into Javascript representation .
- Determines whether a cursor is inside the cursor .
mocha-sidebar Key Features
mocha-sidebar Examples and Code Snippets
Community Discussions
Trending Discussions on mocha-sidebar
QUESTION
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.
- launch.json
- 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:42Invoking 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.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install mocha-sidebar
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page