Consolidate code mode output helper tests (#39969)

## What changed

- Cover object serialization through the `text()` helper directly in the code
  mode runtime suite.
- Remove redundant core integration coverage for serialized text and rejected
  image outputs.

GitOrigin-RevId: f465b8361e9d725a7246994d9c41e9d01c969011
This commit is contained in:
felixxia-oai
2026-08-21 16:41:36 +00:00
committed by copyberry
parent 3432d3f2c9
commit 16e2722c50
2 changed files with 26 additions and 113 deletions

View File

@@ -1055,6 +1055,32 @@ text(JSON.stringify(returnsUndefined));
);
}
#[tokio::test]
async fn text_helper_serializes_objects() {
let service = InProcessCodeModeSession::new();
let response = execute(
&service,
ExecuteRequest {
source: "text({ json: true });".to_string(),
yield_time_ms: None,
..execute_request("")
},
)
.await;
assert_eq!(
response,
RuntimeResponse::Result {
cell_id: cell_id("1"),
content_items: vec![FunctionCallOutputContentItem::InputText {
text: r#"{"json":true}"#.to_string(),
}],
error_text: None,
}
);
}
#[tokio::test]
async fn text_helper_surfaces_stringify_errors() {
let service = InProcessCodeModeSession::new();