wallabyjs / public

Repository for Wallaby.js questions and issues
http://wallabyjs.com
760 stars 45 forks source link

How to start Wallaby when opening a folder in VS2017? #1180

Open spapaseit opened 7 years ago

spapaseit commented 7 years ago

Issue description or question

I'm working on an Aurelia project that has no solution file; it's just a folder, but I user Visual Studio 2017 as code editor so that I can benefit from ReSharper.

Wallaby works fine and all tests pass when using VS Code, but when opening a folder in VS2017 I have no way to start Wallaby. The shortcuts don't work and the Start Wallaby option on the context menu of the wallaby.js file is not present.

Is there a way to start Wallaby when working with folders in Visual Studio 2017?

Wallaby.js configuration file

/* eslint-env node  */

var wallabyWebpack = require('wallaby-webpack');
var wallabyPostprocessor = wallabyWebpack({
    externals: { jQuery: "jQuery" }
});

module.exports = function (wallaby) {
    return {
        files: [
        { pattern: "node_modules/jquery/dist/jquery.js", instrument: false },
        { pattern: "src/**/*.js", load: false },
        { pattern: "test/stubs/**/*.js", load: false },
        { pattern: "test/fakes/**/*.js", load: false },
        { pattern: "test/unit/setup.js", load: false },
        ],

        tests: [
          { pattern: "test/unit/**/*.spec.js", load: false }
        ],

        env: {
            kind: "electron"
        },

        compilers: {
            '**/*.js': wallaby.compilers.babel()
        },

        postprocessor: wallabyPostprocessor,

        setup: function () {
            window.__moduleBundler.loadTests();
        }
    };
}; 

Code editor or IDE name and version

Visual Studio 2017

OS name and version

Windows 10

ArtemGovorov commented 7 years ago

At the moment there's no way to start wallaby without a Visual Studio project file. So as a workaround for now, you may create one (and add it to the .gitignore if no one is using it).

spapaseit commented 7 years ago

That will work, thanks!

rdkleine commented 7 years ago

@ArtemGovorov Will this be on the roadmap in the foreseeable future? We are working in a mixed teams with about 12+ developers, some work in VS Code and some in VS 2017. The .gitignore workaround won't work practically if the VS 2017 have to manage the content of the .csproj file individually.

ArtemGovorov commented 7 years ago

@rdkleine Yes, we are already working on it.

ArtemGovorov commented 7 years ago

@rdkleine Another workaround until it is supported is to use .NET Core project file with glob patterns (so the paths will not have to be maintained/managed).

rdkleine commented 7 years ago

@ArtemGovorov thanks! will try that.

..update: Works!

LayZeeDK commented 6 years ago

Would you be kind enough to post an example, @rdkleine?

rdkleine commented 6 years ago

@LayZeeDK changed company (contractor) in de meantime but a .net core project file would look (somewhat) like the following:

<Project Sdk="Microsoft.NET.Sdk.Web">
  <PropertyGroup>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <Folder Include="wwwroot\" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
    <PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" />
  </ItemGroup>
</Project>

There are no file references in the project file.