Rong is a multi-engine project. Most tests need an engine feature enabled.
By default, rong uses QuickJS. To switch to JavaScriptCore, always use
--no-default-features --features jscore to avoid enabling both engines.
JavaScript suites under tests/unit use @rongjs/test. See the
JavaScript testing guide for its public API,
async execution model, matchers, reports, and embedding contract.
# QuickJS (default on `rong`)
cargo test
# JavaScriptCore
cargo test --no-default-features --features jscoreOn Apple, jscore uses the system JavaScriptCore.framework. To exercise the
source-built (JSCOnly) backend instead, use the jscore-source feature:
cargo test --no-default-features --features jscore-sourceThe source backend always enables JSC execution preemption. Apple
system-framework tests need jscore-interrupt to exercise the private-SPI path.
./test.sh -e jscore lets build.rs download a pinned source artifact or use
one configured through RONG_JSC_ROOT. Set RONG_JSC_SOURCE=1 to force the
source backend in test.sh on Apple too. See
javascriptcore/sys/README.md for artifact setup.
To test a single module, use the -p (package) flag:
# Test rong_http module with QuickJS
cargo test -p rong_http --features quickjs
# Test rong_timer module with JavaScriptCore
cargo test -p rong_timer --features jscore
# Test rong_fs module with QuickJS
cargo test -p rong_fs --features quickjsAvailable modules:
rong_http- HTTP client (fetch)rong_timer- setTimeout/setIntervalrong_fs- File system operationsrong_console- Console loggingrong_buffer- Binary data handlingrong_encoding- Text encoding/decodingrong_event- Event emitterrong_abort- AbortControllerrong_url- URL parsingrong_stream- Stream APIsrong_command- Shell and subprocessesrong_storage- Storage APIsrong_assert- Assertion utilitiesrong_exception- Exception handlingrong_redis- Redis clientrong_sqlite- SQLite databaserong_s3- S3 object storage
# Test all workspace packages
cargo test --workspace
# Test specific modules
cargo test -p rong_http -p rong_timer --features quickjs# Run a specific test function in a module
cargo test -p rong_http test_fetch --features quickjs
# Run all tests matching a pattern
cargo test -p rong_timer timeout --features quickjs
# Show test output
cargo test -p rong_http --features quickjs -- --nocaptureThe repository also provides a small test runner script to execute a single module test suite against a specific engine:
# Test rong_http with QuickJS
./test.sh -e quickjs -t rong_http
# Test rong_http with JavaScriptCore
./test.sh -e jscore -t rong_http
# Test rong_timer with QuickJS
./test.sh -e quickjs -t rong_timerThis script is useful for:
- Quick module testing during development
- CI/CD integration
- Testing across different engines