Search in sources :

Example 1 with JsStringLiteral

use of org.jetbrains.kotlin.js.backend.ast.JsStringLiteral in project kotlin by JetBrains.

the class JSTestGenerator method generateCodeForTestMethod.

private static void generateCodeForTestMethod(@NotNull TranslationContext context, @NotNull FunctionDescriptor functionDescriptor, @NotNull ClassDescriptor classDescriptor, @NotNull JSTester tester) {
    JsExpression expression = ReferenceTranslator.translateAsValueReference(classDescriptor, context);
    JsNew testClass = new JsNew(expression);
    JsExpression functionToTestCall = CallTranslator.INSTANCE.buildCall(context, functionDescriptor, Collections.<JsExpression>emptyList(), testClass);
    JsStringLiteral testName = context.program().getStringLiteral(classDescriptor.getName() + "." + functionDescriptor.getName());
    tester.constructTestMethodInvocation(functionToTestCall, testName);
}
Also used : JsExpression(org.jetbrains.kotlin.js.backend.ast.JsExpression) JsStringLiteral(org.jetbrains.kotlin.js.backend.ast.JsStringLiteral) JsNew(org.jetbrains.kotlin.js.backend.ast.JsNew)

Aggregations

JsExpression (org.jetbrains.kotlin.js.backend.ast.JsExpression)1 JsNew (org.jetbrains.kotlin.js.backend.ast.JsNew)1 JsStringLiteral (org.jetbrains.kotlin.js.backend.ast.JsStringLiteral)1