"""
Check that the JavaScript files and Python versions are in sync.
"""

import glob

from chives import __version__
from chives.javascript import get_version


def test_versions_in_sync() -> None:
    """
    The JavaScript components have the same version as the Python module.
    """
    for filepath in glob.glob("javascript/*.js"):
        print(filepath)
        assert get_version(filepath) == __version__, (
            f"want {__version__}, got {get_version(filepath)}"
        )
