Skip to content

Commit

Permalink
[todomvc] explain integration test workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
anp committed Sep 14, 2020
1 parent 93fa010 commit b6dad5c
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions dom/examples/todo/src/integration_tests.rs
@@ -1,3 +1,10 @@
//! Integration tests for TodoMVC.
//!
//! A module within the application rather than a "proper" integration test
//! because cargo and wasm-pack are conspiring to make that not build somehow.
//! The workaround for now is to make this a module of the app itself, so we
//! have to be on our best behavior and only use public API.

use moxie_dom::{
prelude::*,
raw::{
Expand Down Expand Up @@ -35,10 +42,14 @@ impl Deref for Test {

impl Test {
fn new() -> Self {
super::setup_tracing();
// Please only use public functions from the crate, see module docs for
// explanation.
use super::{boot, setup_tracing};

setup_tracing();
let root = document().create_element("div");
document().body().append_child(&root);
super::boot(root.expect_concrete().clone());
boot(root.expect_concrete().clone());
Test { root }
}

Expand Down

0 comments on commit b6dad5c

Please sign in to comment.