feat: Add test for watch_question.js fixture

This commit is contained in:
Paul Gauthier (aider) 2024-12-11 20:21:42 -08:00
parent 57a24d30b5
commit fee3e9e63b

View file

@ -43,5 +43,13 @@ def test_ai_comment_pattern():
), f"Expected {js_expected} AI comments in JavaScript fixture, found {len(js_lines)}" ), f"Expected {js_expected} AI comments in JavaScript fixture, found {len(js_lines)}"
assert js_has_bang, "Expected at least one bang (!) comment in JavaScript fixture" assert js_has_bang, "Expected at least one bang (!) comment in JavaScript fixture"
# Test watch_question.js fixture
question_js_path = fixtures_dir / "watch_question.js"
question_js_lines, question_js_comments, question_js_has_bang = watcher.get_ai_comments(str(question_js_path))
question_js_expected = 5
assert (
len(question_js_lines) == question_js_expected
), f"Expected {question_js_expected} AI comments in watch_question.js fixture, found {len(question_js_lines)}"
assert question_js_has_bang, "Expected at least one bang (!) comment in watch_question.js fixture"
# add another test for watch_question.js ai! # add another test for watch_question.js ai!