Skip to content

Commit

Permalink
refactor: assert scheduling callback succeeded (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
agostbiro authored Jul 17, 2024
1 parent 8772326 commit 2378037
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/edr_napi/src/solidity_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,16 @@ impl SolidityTestRunner {
results.push(name_and_suite_result.clone());
// Blocking mode won't block in our case because the function was created with
// unlimited queue size https://github.com/nodejs/node-addon-api/blob/main/doc/threadsafe_function.md#blockingcall--nonblockingcall
callback_fn.call(
let call_status = callback_fn.call(
Ok(name_and_suite_result.into()),
ThreadsafeFunctionCallMode::Blocking,
);
// This should always succeed since we're using an unbounded queue. We add an
// assertion for completeness.
assert!(
matches!(call_status, napi::Status::Ok),
"Failed to call callback with status {call_status:?}"
);
}

let js_suite_results = results
Expand Down

0 comments on commit 2378037

Please sign in to comment.