Repository navigation
test(runner): перевести тесты на vitest и jsdom - #173
Merged
Merged
Conversation
chai, chai-dom и @github/query-selector заменены на vitest с @testing-library/jest-dom. Страница урока загружается в jsdom из setupFiles, поиск элементов идёт через src/dom.js, урок запускается командой bin/test.sh, весь курс одним вызовом vitest run. Closes #151 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Тесты уроков переходят с chai, chai-dom и
@github/query-selectorна vitest, тот же стек, что уexercises-javascript.Окружение jsdom: happy-dom отдаёт цвета в той записи, что у студента (
#553333,red), и неверно считает проценты, на нём не прошли 8 тестов CSS. Весь курс теперь прогоняется однимvitest run.Ожидания приведены к вычисленным значениям браузера:
font-weight: boldсравнивается с700;border-style: noneвычисленная толщина рамки 0, правило.borderпроверяется на втором параграфе с этим классом;200%от 22px ожидается как44px, литерал200%ищется в коде;animation-nameне равенnone.Evidence
node test.jsс chai.After: 38 из 38 эталонов зелёные в образе из
docker compose build. На пустомindex.htmlпадают все уроки, у которых есть проверки.hexlet-basics(internal/config/config.go):timeout 6, 1 CPU, 512 МБ, 256 процессов. Под нимиtimeout 6 make --silent -C <урок> test: 2,0–2,1 с, пик памяти 134 МиБ. Прежняя версия на chai: 1,5–1,9 с, 93 МиБ.Merge Danger
Door: two-way
Откат одним revert, данные не меняются.
Blast Radius: курс
Меняется проверка решений всех уроков курса. Сообщения о провале теперь в формате vitest и jest-dom.
Closes #151
🤖 Generated with Claude Code