Skip to content

Commit

Permalink
Add commented out failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
chinedufn committed Mar 15, 2019
1 parent 77cb5fc commit 404dd70
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
16 changes: 8 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
keys:
# Checksum ensures that when we update versions for our `html-macro` dependencies we clear our cache, otherwise
# compiletest-rs can error when the target directory has multiple versions of a crate.
- v5-cargo-cache-test-{{ arch }}-{{ .Branch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
- v5-cargo-cache-test-{{ arch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
- v6-cargo-cache-test-{{ arch }}-{{ .Branch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
- v6-cargo-cache-test-{{ arch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}

# Install nightly & wasm
- run:
Expand Down Expand Up @@ -65,12 +65,12 @@ jobs:

# Save cache
- save_cache:
key: v5-cargo-cache-test-{{ arch }}-{{ .Branch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
key: v6-cargo-cache-test-{{ arch }}-{{ .Branch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
paths:
- target
- /usr/local/cargo
- save_cache:
key: v5-cargo-cache-test-{{ arch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
key: v6-cargo-cache-test-{{ arch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
paths:
- target
- /usr/local/cargo
Expand All @@ -84,8 +84,8 @@ jobs:
# Multiple caches are used to increase the chance of a cache hit.
- restore_cache:
keys:
- v5-cargo-cache-docs-{{ arch }}-{{ .Branch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
- v5-cargo-cache-docs-{{ arch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
- v6-cargo-cache-docs-{{ arch }}-{{ .Branch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
- v6-cargo-cache-docs-{{ arch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}

# Install nightly
- run:
Expand Down Expand Up @@ -120,12 +120,12 @@ jobs:

# Save cache
- save_cache:
key: v5-cargo-cache-docs-{{ arch }}-{{ .Branch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
key: v6-cargo-cache-docs-{{ arch }}-{{ .Branch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
paths:
- target
- /usr/local/cargo
- save_cache:
key: v5-cargo-cache-docs-{{ arch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
key: v6-cargo-cache-docs-{{ arch }}-{{ checksum "./crates/html-macro/Cargo.toml" }}-{{ checksum "./crates/virtual-dom-rs/Cargo.toml" }}
paths:
- target
- /usr/local/cargo
Expand Down
2 changes: 1 addition & 1 deletion crates/html-macro-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ edition = "2018"
[dependencies]
html-macro = {path = "../html-macro"}
virtual-node = {path = "../virtual-node"}
compiletest_rs = "0.3"
compiletest_rs = "0.3.19"
6 changes: 6 additions & 0 deletions crates/html-macro-test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
//! Tests for our html! procedural macro
//!
//! To run all tests in this library:
//!
//! cargo test --color=always --package html-macro-test --lib "" -- --nocapture

#![feature(proc_macro_hygiene)]

use html_macro::html;
Expand Down
16 changes: 16 additions & 0 deletions crates/virtual-dom-rs/tests/closures.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
//! Ensure that our DomUpdater maintains Rc's to closures so that they work even
//! after dropping virtual dom nodes.
//!
//! To run all tests in this file:
//!
//! wasm-pack test crates/virtual-dom-rs --chrome --headless -- --test closures

#![feature(proc_macro_hygiene)]

Expand Down Expand Up @@ -85,6 +89,18 @@ fn closure_not_dropped() {
);
}

// We're just making sure that things compile - other tests give us confidence that the closure
// will work just fine.
//
// https://github.com/chinedufn/percy/issues/81
//
//#[wasm_bindgen_test]
//fn closure_with_no_params_compiles() {
// let _making_sure_this_works = html! {
// <div onclick=|| {}></div>
// };
//}

fn make_input_component(text_clone: Rc<RefCell<String>>) -> VirtualNode {
html! {
<input
Expand Down

0 comments on commit 404dd70

Please sign in to comment.