Quantcast
Channel: Node.js Tools for Visual Studio
Viewing all articles
Browse latest Browse all 4630

Edited Issue: NullReferenceException detecting mocha tests without mocha installed [1115]

$
0
0
If you don't have mocha installed in your project's node_modules, then you'll see this in the output window if you have tests in your project that are marked with TestFramework=mocha

```
Cannot discover test extensions installed by NuGet. The NuGet service is not available. Tests may not be found due to missing test adapter extensions.
========== Discover test finished: 0 found (0:00:00.0625055) ==========
------ Discover test started ------
Cannot discover test extensions installed by NuGet. The NuGet service is not available. Tests may not be found due to missing test adapter extensions.
Processing c:\projects\temp\NodejsConsoleApp9\NodejsConsoleApp9\UnitTest1.js
An exception occurred while test discoverer 'TestDiscoverer' was loading tests. Exception: Object reference not set to an instance of an object.
========== Discover test finished: 0 found (0:00:00.2187577) ==========
```

Installing mocha locally fixes it.

We should provide a better error message, giving a clue to the user to install the test framework.

Viewing all articles
Browse latest Browse all 4630

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>