Beispiel #1
0
        public void CanParseCommand_WithIgnoreFile()
        {
            var expected = $"{NodeModulesPath}eslint -c '{BaseCollectionStep.LocateSettings("default.eslintrc.json")}' '{Args.SourceDirectory}'" +
                           $" --no-eslintrc -o '{Result.MetricsFile}' -f checkstyle" +
                           $"  --ignore-path '{Args.IgnoreFile}'";

            var command = step.PrepareCommand(Args, Result);

            command.Should().Be(expected);
        }
Beispiel #2
0
        public void BeforeEachTest()
        {
            powerShell = CreateMock <IRunPowerShell>();
            step       = new PuppyCrawlerCheckstyleCollectionStep(powerShell.Object);

            expectedCommand = PuppyCrawlerCheckstyleCollectionStep.CheckstyleCommand
                              .FormatWith(BaseCollectionStep.LocateBinaries("checkstyle-6.18-all.jar"),
                                          BaseCollectionStep.LocateSettings("metropolis_checkstyle_metrics.xml"),
                                          Result.MetricsFile, Args.SourceDirectory);
        }
Beispiel #3
0
        public void CanParseCommand_NoIgnoreFile()
        {
            Args.IgnoreFile = string.Empty; //no ignore path in this example

            var expected = $"{NodeModulesPath}eslint -c '{BaseCollectionStep.LocateSettings("default.eslintrc.json")}' '{Args.SourceDirectory}\\**' " +
                           $"-o '{Result.MetricsFile}' -f checkstyle";

            var command = step.PrepareCommand(Args, Result);

            command.Should().Be(expected);
        }
Beispiel #4
0
        public void ShouldPickupBabelReactConfig_WithBabelReact()
        {
            Args.IgnoreFile        = string.Empty; //no ignore path in this example
            Args.EcmaScriptDialect = EslintPasringOptions.BABEL_REACT;

            var expected = $"{NodeModulesPath}eslint -c '{BaseCollectionStep.LocateSettings("babel_react.eslintrc.json")}' '{Args.SourceDirectory}'" +
                           $" --no-eslintrc -o '{Result.MetricsFile}' -f checkstyle  --ext .js,.jsx";

            var command = step.PrepareCommand(Args, Result);

            command.Should().Be(expected);
        }