use of com.jscs.cli.JscsSettings in project jscs-plugin by idok.
the class Settings method toJscsSettings.
public JscsSettings toJscsSettings() {
JscsSettings settings = new JscsSettings();
settings.node = nodeInterpreter;
settings.jscsExecutablePath = jscsExecutable;
settings.preset = preset;
settings.config = jscsrcFile;
settings.esnext = esnext;
settings.esprima = esprima;
return settings;
}
use of com.jscs.cli.JscsSettings in project jscs-plugin by idok.
the class JscsRunnerTest method testVersion.
@Test
public void testVersion() {
JscsSettings settings = createSettings();
try {
String version = JscsRunner.version(settings);
assertEquals("version should be", "1.6.1", version);
} catch (ExecutionException e) {
e.printStackTrace();
}
}
use of com.jscs.cli.JscsSettings in project jscs-plugin by idok.
the class JscsRunnerTest method testSimpleLintJSX.
@Test
public void testSimpleLintJSX() {
String file = JSCS_PLUGIN_ROOT + "/testData/jsx.js";
JscsSettings settings = createSettings(file);
settings.esprima = "esprima-fb";
LintResult result = JscsRunner.lint(settings);
System.out.println(result.errorOutput);
System.out.println(result.jscsLint.file.name);
System.out.println("found " + result.jscsLint.file.errors.size() + " issues");
for (JscsLint.Issue err : result.jscsLint.file.errors) {
System.out.println(err.message);
}
assertEquals("File should match", file, result.jscsLint.file.name);
assertEquals("Should be no errors", 0, result.jscsLint.file.errors.size());
}
use of com.jscs.cli.JscsSettings in project jscs-plugin by idok.
the class JscsRunnerTest method testSimpleLintES6.
@Test
public void testSimpleLintES6() {
String file = JSCS_PLUGIN_ROOT + "/testData/es6.js";
JscsSettings settings = createSettings(file);
settings.esnext = true;
LintResult result = JscsRunner.lint(settings);
System.out.println(result.errorOutput);
System.out.println(result.jscsLint.file.name);
System.out.println("found " + result.jscsLint.file.errors.size() + " issues");
for (JscsLint.Issue err : result.jscsLint.file.errors) {
System.out.println(err.message);
}
assertEquals("File should match", file, result.jscsLint.file.name);
assertEquals("Should be no errors", 0, result.jscsLint.file.errors.size());
}
use of com.jscs.cli.JscsSettings in project jscs-plugin by idok.
the class JscsRunnerTest method testSimpleLint2.
// @Test
// public void testSimpleLint() {
// JscsSettings settings = createSettings(JSCS_PLUGIN_ROOT + "/testData/eq.js");
// ProcessOutput out;
// try {
// out = JscsRunner.lint(settings);
//// System.out.println(settings);
// System.out.println(out.getStdout());
// assertEquals("Exit code should be 1", 1, out.getExitCode());
// } catch (ExecutionException e) {
// e.printStackTrace();
// }
// }
@Test
public void testSimpleLint2() {
JscsSettings settings = createSettings(JSCS_PLUGIN_ROOT + "/testData/test.js");
LintResult result = JscsRunner.lint(settings);
System.out.println(result.errorOutput);
System.out.println(result.jscsLint.file.name);
System.out.println("found " + result.jscsLint.file.errors.size() + " issues");
for (JscsLint.Issue err : result.jscsLint.file.errors) {
System.out.println(err.message);
}
assertEquals("Exit code should be 1", JSCS_PLUGIN_ROOT + "/testData/test.js", result.jscsLint.file.name);
}
Aggregations