none
Visual Studio 2017 Launch Settings for Nodejs RRS feed

  • Question

  • Hello,

    I'm using the "Open Folder" option of Visual Studio 2017 to open Nightwatch tests and would like Visual Studio to run the currently opened test when I hit the play button.

    To run a specific test, I would open a command prompt and type "node nightwatch.js --test tests/someArea/someTestSuite.js".  I've tried setting the "args" parameter in the launch.vs.json file, however, it seems to be passing that as a parameter to node and not to Nightwatch.  I get an error from node saying it cannot load module "nightwatch.js --test tests/someArea/someTestSuite.js".  How do it I get it to pass arguments to Nightwatch?

    I found this blog post where someone had the same issue but with Visual Studio Code.  I tried their approach, but I haven't had any luck getting it to work.  I'm not sure if it is because the launch file version on the blog post is 0.1.0 and mine is 0.2.1 or if there are schema differences between VSCode and VS2017's launch file.  I've found VSCode's launch JSON documentation here.  Where's Visual Studio 2017's?

    Thanks,
    Jacob

    Friday, April 14, 2017 6:58 PM

All replies

  • Hi Jacob,

    Please try the steps below:

    Right-click the project name in Solution Explorer, you will see the window like below:

    I think the script arguments will help.

    Best regards,

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, April 17, 2017 9:50 AM
  • Hi Fletch,

    I'm using the "Open Folder" option, so there's no project to right click on.

    Thanks,
    Jacob

    Monday, April 17, 2017 2:00 PM
  • Hi Jacob, 

    l just found similar issue which is also about passing argument through command line

    https://github.com/nightwatchjs/nightwatch/issues/498

    please refer to MateuszJeziorski's reply. 

    Hope it helps.

    Best regards, 

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Monday, April 24, 2017 4:31 PM
  • Hi Fletch,

    That isn't quite what I'm looking for...

    Is there documentation somewhere on Visual Studio 2017's launch.vs.json file?

    Ideally, I'd like to do "Open Folder" on the Nighwatch stuff and when I click the play button, it would run the currently opened test.

    Thanks,
    Jacob

    Tuesday, May 2, 2017 8:49 PM