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

Commented Feature: I want to start the project without a startup script [883]

$
0
0
Use case: I need to debug my karma tests
- I created a new node project
- I added a dependency on karma
- I added a few tests
- I went to the project properties and set:
Node.exe arguments: karma
Script.exe arguments: start
Launch url: http://localhost:9876/
- I hit F5
Error: No startup file is defined for the startup project.

My workaround:

- I added a start-karma.js to my project. It's a one liner:
require('./node_modules/karma/lib/cli.js').run();
- I made start-karma.js the startup script
- I went to the project properties and set:
Node.exe arguments: <<empty>>
Script.exe arguments: start
Launch url: http://localhost:9876/
- I hit F5 and voila.

It would be better (and easier to figure out) if I did not have to use this workaround.

Comments: I managed to configure the project to start with the karma configuration file without using the "start-karma.js". To do that I manually modified the Node.Js project properties from the Visual Studio Solution Explorer. This is how my project properties look now: ![Image](https://raw.githubusercontent.com/popalexandruvasile/rentthatbike/master/docs/images/nodejstools_karma_projectproperties.PNG) You can find the project that I am working with in this branch: https://github.com/popalexandruvasile/rentthatbike/tree/chapter5-example1

Viewing all articles
Browse latest Browse all 4630

Trending Articles



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