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

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

    text = """\
import React from 'react';

interface Person {
  name: string;
  age: number;
}

const ExampleComponent: React.FC = () => {
  const person: Person = {
    name: 'John Doe',
    age: 30,
  };

  return (
    <div>
      <h1>Hello, {person.name}!</h1>
      <p>You are {person.age} years old.</p>
    </div>
  );
};

export default ExampleComponent;"""

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

    # Test the first chunk (import statement)
    assert chunks[0].text == text
    assert chunks[0].metadata["inclusive_scopes"] == []

    # Test the second chunk (interface definition)
    assert (
        chunks[1].text
        == """\
interface Person {
  name: string;
  age: number;
}"""
    )
    assert chunks[1].metadata["inclusive_scopes"] == [
        {
            "name": "Person",
            "type": "interface_declaration",
            "signature": "interface Person",
        }
    ]
    assert (
        cast(RelatedNodeInfo, chunks[1].relationships[NodeRelationship.PARENT]).node_id
        == chunks[0].id_
    )
    assert chunks[1].relationships[NodeRelationship.CHILD] == []

    # Test the third chunk (ExampleComponent function definition)
    assert (
        chunks[2].text
        == """\
const ExampleComponent: React.FC = () => {
  const person: Person = {
    name: 'John Doe',
    age: 30,
  };

  return (
    <div>
      <h1>Hello, {person.name}!</h1>
      <p>You are {person.age} years old.</p>
    </div>
  );
};"""
    )
    assert chunks[2].metadata["inclusive_scopes"] == [
        {
            "name": "ExampleComponent",
            "type": "lexical_declaration",
            "signature": "const ExampleComponent: React.FC = () =>",
        }
    ]
    assert (
        cast(RelatedNodeInfo, chunks[2].relationships[NodeRelationship.PARENT]).node_id
        == chunks[0].id_
    )

    # TODO: Unfortunately tree_splitter errors on the html elements
Test case for code splitting using TypeScript JSX (TSX).
llama-index-packs/llama-index-packs-code-hierarchy/tests/test_code_hierarchy_no_skeleton.py