def METHOD_NAME(ctx):
    all_files = list(ctx.files.srcs)
    test_cmd = [
        "yarn test_ci",
    ]
    if ctx.configuration.coverage_enabled:
        test_cmd = [
            "yarn coverage_ci",
            "sed -i \"s|SF:src|SF:src/ui/src|g\" coverage/lcov.info",
            "cp coverage/lcov.info ${COVERAGE_OUTPUT_FILE}",
        ]
    cp_cmds = ["cp -aL --parents {} $TMPPATH".format(file.path) for file in all_files]
    cmd = ui_shared_cmds_start + cp_cmds + [
        'pushd "$TMPPATH/src/ui" &> /dev/null',
        "export JEST_JUNIT_OUTPUT_NAME=${XML_OUTPUT_FILE:-junit.xml}",
        'tar -xzf "$BASE_PATH/{}"'.format(ctx.file.deps.short_path),
    ] + test_cmd + ui_shared_cmds_finish
    script = " && ".join(cmd)
    ctx.actions.write(
        output = ctx.outputs.executable,
        content = script,
        is_executable = True,
    )
    runfiles = ctx.runfiles(files = ctx.files.srcs + ctx.files.deps)
    return [
        DefaultInfo(
            executable = ctx.outputs.executable,
            runfiles = runfiles,
        ),
        coverage_common.instrumented_files_info(
            ctx,
            source_attributes = ["srcs"],
            dependency_attributes = ["deps"],
            extensions = ["ts", "tsx", "js", "jsx"],
        ),
    ]