Skip to content

Commit

Permalink
feat: added initial es6 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Fluctuationqt authored and vmutafov committed Nov 2, 2021
1 parent c8d746b commit d5ae321
Show file tree
Hide file tree
Showing 16 changed files with 111 additions and 2,836 deletions.
Expand Up @@ -433,34 +433,4 @@ protected void runTest(IJavascriptEngineExecutor executor, IRepository repositor
System.out.println(String.format("API test [%s] on engine [%s] passed for: %d ms", testModule,
executor.getType(), time));
}

protected void runEcmaScriptTest(IJavascriptEngineExecutor executor, IRepository repository, String testModule) throws IOException, ScriptingException {

try {
InputStream in = AbstractApiSuiteTest.class.getResourceAsStream("/META-INF/dirigible/" + testModule);
try {
if (in == null) {
throw new IOException(IRepositoryStructure.SEPARATOR + testModule + " does not exist");
}
repository.createResource(
IRepositoryStructure.PATH_REGISTRY_PUBLIC + IRepositoryStructure.SEPARATOR + testModule,
IOUtils.readBytesFromStream(in));
} finally {
if (in != null) {
in.close();
}
}
} catch (RepositoryWriteException e) {
throw new IOException(IRepositoryStructure.SEPARATOR + testModule, e);
}
Object result = null;
long start = System.currentTimeMillis();
Object error = executor.executeServiceModule(testModule, null);
if (error != null && error.toString() != null) {
throw new ScriptingException(error.toString());
}
long time = System.currentTimeMillis() - start;
System.out.println(String.format("API test [%s] on engine [%s] passed for: %d ms", testModule,
executor.getType(), time));
}
}
Expand Up @@ -20,4 +20,10 @@ exports.assertNotNull = function (condition, message) {
if (condition === null) {
throw(message || "Assertion failed");
}
}

exports.assertEquals = function assertEquals(actual, expected, message) {
if (expected !== actual) {
throw(message || "Assertion failed");
}
}
202 changes: 0 additions & 202 deletions cjs-to-es6/LICENSE

This file was deleted.

97 changes: 0 additions & 97 deletions cjs-to-es6/README.md

This file was deleted.

0 comments on commit d5ae321

Please sign in to comment.