Registry / testing / tokio-mock-task

tokio-mock-task

JSON →
library0.1.1rscratesunverified

Mock a Tokio task for testing purposes.

# Cargo.toml [dependencies] tokio-mock-task = "0.1.1"
INSTALL
IMPORT
SIG · TOKIO-MOCK-TASK
T
tokio-mock-task
testingrustv0.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MockTask
use tokio_mock_task::MockTask;

Creates a mock Tokio task for testing async code.

use tokio_mock_task::MockTask; #[tokio::test] async fn test_task() { let task = MockTask::new(); task.spawn(async { // your test logic }); }
Debug
Known issues
gotchaRequires Tokio runtime to be active
fix
Ensure tests are run with #[tokio::test] or similar runtime attribute.
affects: >=0.1.0
Upgrade
Version history
0.1.1latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
39 hits · last 30 days
node
34
Resources
tokio-mock-task — cargo add tokio-mock-task · libregistry