chuẩn_bị
Translation status: Tiếng Việt reader-locale proof. Term names and code fences follow the vi pack; supporting prose may still be English.
Registers a before-each test hook.
Syntax: chuẩn_bị <block>
Category#
testing
Related#
Examples#
radix/corpus/praepara/praepara.fab (canonical · keyword)#
Registers a before-each test hook.
# =============================================================================
# chuẩn_bị — Registers a before-each test hook.
# =============================================================================
#
# What this teaches:
# • Testing setup hooks — `chuẩn_bị` registers a block that runs before each
# test case (`kiểm_thử`) in the suite, ensuring shared state or side effects
# are prepared
# • Works with `sau_chuẩn_bị` (after-each) for paired setup/teardown
#
# Common mistakes:
# • Confusing `chuẩn_bị` (setup) with `sau_chuẩn_bị` (teardown) — they run at opposite ends of each test.
#
# See also: sau_chuẩn_bị, tất_cả
# =============================================================================
# chuẩn_bị — before-each test hook
#
# GRAMMAR:
# hookDecl :← 'chuẩn_bị' block
#
# EXPECTED OUTPUT:
# No bắt_đầu — declaration or test-runner surface only.
#
# BACKEND:
# declaration-only test hook (whitelist: chuẩn_bị/praepara.fab).
#
describe "hooks" {
setup {
print "before each"
}
test "sample" {
assert true
}
}