use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.
the class N4jsLibsTest method testN4jsLibs.
/**
*/
@Test
public void testN4jsLibs() throws IOException {
final Path n4jsRootPath = UtilN4.findN4jsRepoRootPath();
final Path n4jsLibsRootPath = n4jsRootPath.resolve(N4JSGlobals.N4JS_LIBS_FOLDER_NAME);
final Path testReportPath = n4jsLibsRootPath.resolve("build").resolve("report.xml");
Files.deleteIfExists(testReportPath);
CliTools cliTools = new CliTools();
cliTools.setInheritIO(true);
ProcessResult result = cliTools.yarnRun(n4jsLibsRootPath, "run", "test");
assertEquals("non-zero exit code", 0, result.getExitCode());
assertTrue("test report not found", Files.isRegularFile(testReportPath));
}
use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.
the class AT_IDEBUG_654_ExportPlainJsModulesTest method compileCheckModuleExportFromPlainJsFile_ExpectAvailable.
/**
*/
@Test
public void compileCheckModuleExportFromPlainJsFile_ExpectAvailable() {
Path projectDir = workspace.toPath().resolve(WS_IDEBUG_654);
Path fileToRun = projectDir.resolve("src-gen/Client.js");
N4jscOptions options = COMPILE(workspace);
CliCompileResult cliResult = n4jsc(options);
assertEquals(cliResult.toString(), 2, cliResult.getTranspiledFilesCount());
ProcessResult nodejsResult = nodejsRun(projectDir, fileToRun);
assertEquals(nodejsResult.toString(), "foo === 36: true, bar === 'bar': true", nodejsResult.getStdOut());
}
use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.
the class IncompleteApiImplementationTest method testEnums_normal_existing_EnumSB.
/**
*/
@Test
public void testEnums_normal_existing_EnumSB() {
String expectedString = "Loaded Implementation one.x.impl::p.A.n4js" + "\n" + "OK: holds not undefined" + "\n" + "OK: holds not undefined" + "\n" + "OK: holds not undefined";
String fileToRunName = fileToExecute_direct("Exec_AT_IDE_1510_Enums_normal_existing_EnumSB.js");
ProcessResult nodejsResult = nodejsRun(workspace.toPath(), Path.of(fileToRunName));
assertEquals(nodejsResult.toString(), expectedString, nodejsResult.getStdOut());
}
use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.
the class IncompleteApiImplementationTest method testfield_vs_getset_4.
/**
*/
@Test
public void testfield_vs_getset_4() {
String expectedString = "Loaded Implementation one.x.impl::fields.F.n4js";
String fileToRunName = fileToExecute_fields("Exec_AT_IDEBUG-505_field_vs_getset_5.js");
ProcessResult nodejsResult = nodejsRun(workspace.toPath(), Path.of(fileToRunName));
assertEquals(nodejsResult.toString(), expectedString, nodejsResult.getStdOut());
}
use of org.eclipse.n4js.cli.helper.ProcessResult in project n4js by eclipse.
the class IncompleteApiImplementationTest method testMissing_method_in_class.
/**
*/
@Test
public void testMissing_method_in_class() {
String fileToRunName = fileToExecute_direct("Exec_missing_field_in_class.js");
ProcessResult nodejsResult = nodejsRun(workspace.toPath(), Path.of(fileToRunName));
String expectedString = "Loaded Implementation one.x.impl::p.A.n4js";
assertEquals(nodejsResult.toString(), expectedString, nodejsResult.getStdOut());
}
Aggregations