From b6dad5c6b6267157f16d692be45638f2bb67b626 Mon Sep 17 00:00:00 2001 From: Adam Perry Date: Mon, 14 Sep 2020 07:25:27 -0700 Subject: [PATCH] [todomvc] explain integration test workaround --- dom/examples/todo/src/integration_tests.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dom/examples/todo/src/integration_tests.rs b/dom/examples/todo/src/integration_tests.rs index b9348bbd3..13c900350 100644 --- a/dom/examples/todo/src/integration_tests.rs +++ b/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::{ @@ -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 } }