avajs/ava — 20.8k★ trên GitHub (JavaScript). Node.js test runner that lets you develop with confidence 🚀
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Please support our friend Vadim Demedes and the people in Ukraine.
AVA is a test runner for Node.js with a concise API, detailed error output, embrace of new language features and thread isolation that lets you develop with confidence 🚀
Watch this repository and follow the Discussions for updates.
Read our contributing guide if you're looking to contribute (issues / PRs / etc).
Make sure to install AVA locally. AVA cannot be run globally.
Don't forget to configure the test script in your package.json as per above.
Create your test file
Create a file named test.js in the project root directory.
Note that AVA's documentation assumes you're using ES modules.
import test from 'ava';
test('foo', t => {
t.pass();
});
test('bar', async t => {
const bar = Promise.resolve('bar');
t.is(await bar, 'bar');
});
Running your tests
npm test
Or with npx:
npx ava
Run with the --watch flag to enable AVA's watch mode:
npx ava --watch
Supported Node.js versions
AVA supports the latest release of any major version that is supported by Node.js itself. Read more in our support statement.
Highlights
Magic assert
AVA adds code excerpts and clean diffs for actual and expected values. If values in the assertion are objects or arrays, only a diff is displayed, to remove the noise and focus on the problem. The diff is syntax-highlighted too! If you are comparing strings, both single and multi line, AVA displays a different kind of output, highlighting the added or missing characters.
Clean stack traces
AVA automatically removes unrelated lines in stack traces, allowing you to find the source of an error much faster, as seen above.
Parallel runs in CI
AVA automatically detects whether your CI environment supports parallel builds. Each build will run a subset of all test files, while still making sure all tests get executed. See the ci-parallel-vars package for a list of supported CI environments.
Documentation
Please see the files in the docs directory:
Writing tests
Execution context
Assertions
Snapshot testing
Command line (CLI)
Configuration
Test timeouts
Common pitfalls
We have a growing list of common pitfalls you may experience while using AVA. If you encounter any issues you think are common, comment in this issue.
Recipes
Test setup
TypeScript
Shared workers
Watch mode
When to use t.plan()
Passing arguments to your test files
Splitting tests in CI
Code coverage
Endpoint testing
Browser testing
Testing Vue.js components
Debugging tests with Chrome DevTools
Debugging tests with VSCode
Debugging tests with WebStorm
Isolated MongoDB integration tests
Testing web apps using Puppeteer
Testing web apps using Selenium WebDriverJS
FAQ
How is the name written and pronounced?
AVA, not Ava or ava. Pronounced /ˈeɪvə/: Ay (face, made) V (vie, have) A (comma, ago)
What is the header background?
It's the Andromeda galaxy.
What is the difference between concurrency and parallelism?
Concurrency is not parallelism. It enables parallelism.
Support
GitHub Discussions
Related
eslint-plugin-ava — Lint rules for AVA tests
@ava/typescript — Test TypeScript projects
@ava/cooperate — Low-level primitives to enable cooperation between test files
Có — avajs/ava phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/avajs/ava.
avajs/ava là gì?
avajs/ava (avajs/ava) là dự án JavaScript trên GitHub. Theo mô tả gốc: Node.js test runner that lets you develop with confidence 🚀
avajs/ava so với các dự án Developer Tools khác thế nào?
avajs/ava được TopGit xếp vào nhóm Developer Tools, với 20.8k sao GitHub và viết bằng JavaScript. Xem trang chủ đề Developer Tools trên TopGit để so sánh với các dự án tương tự theo số sao và mức độ hoạt động.
Cùng nhóm Developer Tools còn repo nào?
avajs/ava thuộc nhóm Developer Tools trên TopGit, cùng 18 topic GitHub. Trang Trending và Topics liệt kê các repo cùng số sao và cùng ngôn ngữ để so sánh.
Đọc thêm về avajs/ava ở đâu?
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/avajs/ava là nguồn chính thức.
Vì sao avajs/ava được xếp vào nhóm Developer Tools?
TopGit xếp avajs/ava vào nhóm Developer Tools dựa trên GitHub topics và mô tả của repo (gắn thẻ: "assert", "async", "async-functions"). Việc phân loại dựa trên metadata thật của repo, không phải đoán theo cảm tính biên tập.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về ava?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về ava.