Skip to content

Commit

Permalink
test: IIFE
Browse files Browse the repository at this point in the history
  • Loading branch information
Valerioageno committed Mar 8, 2024
1 parent c79733c commit d8d6dbd
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
Expand Up @@ -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();
Expand Down

0 comments on commit d8d6dbd

Please sign in to comment.