mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
chore: clean up unused imports in tests
This commit is contained in:
parent
9330cf23b1
commit
27f2e60d16
2 changed files with 46 additions and 15 deletions
|
@ -1,18 +1,23 @@
|
|||
use any_spawner::Executor;
|
||||
use reactive_graph::{
|
||||
#[cfg(feature = "effects")]
|
||||
pub mod imports {
|
||||
pub use any_spawner::Executor;
|
||||
pub use reactive_graph::{
|
||||
effect::{Effect, RenderEffect},
|
||||
prelude::*,
|
||||
signal::RwSignal,
|
||||
};
|
||||
use std::{
|
||||
pub use std::{
|
||||
mem,
|
||||
sync::{Arc, RwLock},
|
||||
};
|
||||
use tokio::task;
|
||||
pub use tokio::task;
|
||||
}
|
||||
|
||||
#[cfg(feature = "effects")]
|
||||
#[tokio::test]
|
||||
async fn render_effect_runs() {
|
||||
use imports::*;
|
||||
|
||||
_ = Executor::init_tokio();
|
||||
task::LocalSet::new()
|
||||
.run_until(async {
|
||||
|
@ -46,6 +51,8 @@ async fn render_effect_runs() {
|
|||
#[cfg(feature = "effects")]
|
||||
#[tokio::test]
|
||||
async fn effect_runs() {
|
||||
use imports::*;
|
||||
|
||||
_ = Executor::init_tokio();
|
||||
|
||||
task::LocalSet::new()
|
||||
|
@ -78,6 +85,8 @@ async fn effect_runs() {
|
|||
#[cfg(feature = "effects")]
|
||||
#[tokio::test]
|
||||
async fn dynamic_dependencies() {
|
||||
use imports::*;
|
||||
|
||||
_ = Executor::init_tokio();
|
||||
|
||||
task::LocalSet::new()
|
||||
|
|
|
@ -1,17 +1,31 @@
|
|||
use any_spawner::Executor;
|
||||
use reactive_graph::{
|
||||
computed::{ArcMemo, Memo},
|
||||
prelude::*,
|
||||
signal::RwSignal,
|
||||
wrappers::read::Signal,
|
||||
};
|
||||
use std::{
|
||||
rc::Rc,
|
||||
sync::{Arc, RwLock},
|
||||
};
|
||||
|
||||
#[cfg(feature = "effects")]
|
||||
pub mod imports {
|
||||
pub use any_spawner::Executor;
|
||||
pub use reactive_graph::{
|
||||
computed::{ArcMemo, Memo},
|
||||
effect::{Effect, RenderEffect},
|
||||
prelude::*,
|
||||
signal::RwSignal,
|
||||
wrappers::read::Signal,
|
||||
};
|
||||
use std::{
|
||||
pub use std::{
|
||||
mem,
|
||||
rc::Rc,
|
||||
sync::{Arc, RwLock},
|
||||
};
|
||||
use tokio::task;
|
||||
pub use tokio::task;
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn memo_calculates_value() {
|
||||
|
@ -173,6 +187,8 @@ fn diamond_problem() {
|
|||
#[cfg(feature = "effects")]
|
||||
#[tokio::test]
|
||||
async fn dynamic_dependencies() {
|
||||
use imports::*;
|
||||
|
||||
_ = Executor::init_tokio();
|
||||
|
||||
let first = RwSignal::new("Greg");
|
||||
|
@ -248,6 +264,8 @@ async fn dynamic_dependencies() {
|
|||
#[cfg(feature = "effects")]
|
||||
#[tokio::test]
|
||||
async fn render_effect_doesnt_rerun_if_memo_didnt_change() {
|
||||
use imports::*;
|
||||
|
||||
_ = Executor::init_tokio();
|
||||
|
||||
task::LocalSet::new()
|
||||
|
@ -289,6 +307,8 @@ async fn render_effect_doesnt_rerun_if_memo_didnt_change() {
|
|||
#[cfg(feature = "effects")]
|
||||
#[tokio::test]
|
||||
async fn effect_doesnt_rerun_if_memo_didnt_change() {
|
||||
use imports::*;
|
||||
|
||||
_ = Executor::init_tokio();
|
||||
|
||||
task::LocalSet::new()
|
||||
|
@ -323,6 +343,8 @@ async fn effect_doesnt_rerun_if_memo_didnt_change() {
|
|||
#[cfg(feature = "effects")]
|
||||
#[tokio::test]
|
||||
async fn effect_depending_on_signal_and_memo_doesnt_rerun_unnecessarily() {
|
||||
use imports::*;
|
||||
|
||||
_ = Executor::init_tokio();
|
||||
|
||||
task::LocalSet::new()
|
||||
|
|
Loading…
Reference in a new issue