Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: IIFE
Browse files Browse the repository at this point in the history
Valerioageno committed Mar 8, 2024
1 parent bd2dda2 commit 6238282
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ssr.rs
Original file line number Diff line number Diff line change
@@ -202,6 +202,15 @@ mod tests {
);
}

#[test]
fn executes_iife_source() {
init_test();
let source = r##"(() => ({x: () => 'rendered HTML'}))()"##;

let mut js = Ssr::from(source.to_owned(), "").unwrap();
assert_eq!(js.render_to_string(None).unwrap(), "rendered HTML");
}

#[test]
fn pass_param_to_function() {
init_test();

0 comments on commit 6238282

Please sign in to comment.