在选中应用目录中运行测试。执行测试前,CLI 会重新创建一个内置 Docker 测试数据库,并注入内部使用的 DB_* 环境变量。
DB_*
nb source test [paths...] [flags]
[paths...]
--cwd
-c
--watch
-w
--run
--allowOnly
.only
--bail
--coverage
--single-thread
--server
--client
--db-clean
-d
--db-dialect
postgres
mysql
mariadb
kingbase
--db-image
--db-port
--db-database
--db-user
--db-password
--verbose
nb source test nb source test --cwd /path/to/app nb source test packages/core/server/src/__tests__/foo.test.ts nb source test --server --coverage nb source test --db-port 5433
nb source build
nb db ps