Перейти до вмісту

Тестування коду

Інструменти для тестування коду

Ми виокремлюємо цікаві функції або бібліотеки, про які, на нашу думку, вам варто знати.

Бібліотека від нас: bun test

After years of hoping for a more unified toolchain, it looks like JavaScript developers might finally be starting to get their wish.

Bun test is just one example of a test runner being baked into the runtime, with Node and Deno offering their own equivalents.

Корисні джерела

Співвідношення інструментів тестування з часом

While Jest has long enjoyed a comfortable spot as the most-used testing tool, Vitest is climbing the ranks so fast that it wouldn't be surprising to see it overtake it in the upcoming year, especially with Jest's satisfaction ratio trending down.

Meanwhile, Storybook is an interesting case study in a project trying its best to address its users' frustrations. It's still showing a slight satisfaction loss compared to last year, but the rate of decline has slowed, and things might start looking up soon.

Jest
Mocha
Storybook
Cypress
Puppeteer
Testing Library
Playwright
WebdriverIO
Vitest
Selenium
TestCafe
Mock Service Worker
Node Test Runner
bun test

Режим:

Вигляд:

Використання:

Частка респондентів, які використовували це
0%
20%
40%
60%
80%
100%
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
0%
20%
40%
60%
80%
100%

Інші інструменти тестування

While Deno's test runner wasn't included in the survey's main options, it did come first in freeform mentions.
0%
20%
40%
60%
80%
100%
1
+3
2
-1
3
-2
+3
5
6
Інші відповіді
0%
20%
40%
60%
80%
100%
Ми покликали спільноту JavaScript поділитися своїм “вибором року”

Мій вибір 2025: SST

I didn't know about SST just a year ago, but I started using it for a new work project and it's been fanstastic! It really deserves more exposure.
Ми покликали спільноту JavaScript поділитися своїм “вибором року”

Кількість опцій

While other categories so far have hovered around 1-2 tools used, when it comes to testing respondents averaged a whopping 4.4, a sign that people may still be looking for that perfect test runner, and that things are far from settled in this area.
0%
4%
7%
11%
15%
19%
01
0
02
1
03
2
04
3
05
4
06
5
07
6
08
7
09
8
10
9
11
10
12
11
13
12
14
13
15
14
0%
4%
7%
11%
15%
19%

Задоволення інструментами тестування

Happiness remains stable, with a slight uptick over the past three years.
1
2
3
4
5
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
1
2
3
4
5
Середнє

Проблеми інструментів тестування

Mocking remains a major pain point for developers, with configuration and setup not far behind.
З якими проблемами ви стикалися під час використання інструментів для тестування коду?
Множинний вибір
Головні проблеми загалом.

Вигляд:

Елементи, що не є одним(-ою) із “limitations”
0%
20%
40%
60%
80%
100%
01
Створення макетів (Mocking)
3
02
Конфігурація
03
long_time_to_run
04
Недетермінованість (Flakiness)
+3
05
Тестування клієнтської частини
1
+11
06
-2
07
Cognitive overload
5
08
Education
4
09
writing_tests
10
Test Environments
11
ESM & CJS
-7
12
Debugging
1
13
Проблеми тестування у браузері
-5
14
Тестування E2E
-5
15
Tooling
3
16
Developer Experience
17
Підтримання TypeScript
-6
18
Швидкодія
-15
19
20
Інтеграція інструментів
-2
21
Тестування асинхронного
-6
22
+1
23
not_testing
24
Модульне тестування
-12
0%
20%
40%
60%
80%
100%

Рекомендовані джерела

Testing Fundamentals
Steve Kinney
Temporal

Testing Fundamentals

Ship code with confidence! Learn the basics of testing and apply Test-Driven Development techniques to your workflow. Create automated tests for DOM elements and user interactions. Use mocks and spies to control your environment and test more complex code.
Enterprise UI Development: Testing & Code Quality
Steve Kinney
Temporal

Enterprise UI Development: Testing & Code Quality

Learn unit testing with Vitest, continuous integration via GitHub Actions, component and accessibility testing with Ax, mocking techniques, and code standard enforcement using ESLint and Husky & Lint-Staged.
Спонсорований вміст від наших партнерів. Детальніше.