def test_typescript_code_splitter_2() -> None:
    """Test case for code splitting using TypeScript."""
    if "CI" in os.environ:
        return

    code_splitter = CodeHierarchyNodeParser(
        language="typescript", skeleton=True, chunk_min_characters=0
    )

    text = """\
class Example {
    exampleMethod() {
        console.log("line1");
    }
}
"""

    text_node = TextNode(
        text=text,
    )
    chunks: List[RelatedNodeInfo] = code_splitter.get_nodes_from_documents([text_node])

    # Fstrings don't like forward slash
    double_forward_slash: str = "//"
    assert (
        chunks[0].text
        == f"""\
class Example {{
    {double_forward_slash} {CodeHierarchyNodeParser._get_comment_text(chunks[1])}
}}
"""
    )
Test case for code splitting using TypeScript.
llama-index-packs/llama-index-packs-code-hierarchy/tests/test_code_hierarchy_with_skeleton.py