Replace #[tokio::test] w/ wasm-ok macro calls
This commit is contained in:
parent
383f1cafea
commit
8bf28012e4
|
@ -7,7 +7,8 @@ wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn test_registration() {
|
async fn test_registration() {
|
||||||
let bundle = common::setup().await;
|
let bundle = common::setup().await;
|
||||||
let reg = RegisterSchema {
|
let reg = RegisterSchema {
|
||||||
|
|
|
@ -11,7 +11,8 @@ use wasm_bindgen_test::*;
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
wasm_bindgen_test_configure!(run_in_browser);
|
wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn get_channel() {
|
async fn get_channel() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let bundle_channel = bundle.channel.read().unwrap().clone();
|
let bundle_channel = bundle.channel.read().unwrap().clone();
|
||||||
|
@ -24,7 +25,8 @@ async fn get_channel() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn delete_channel() {
|
async fn delete_channel() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let channel_guard = bundle.channel.write().unwrap().clone();
|
let channel_guard = bundle.channel.write().unwrap().clone();
|
||||||
|
@ -33,7 +35,8 @@ async fn delete_channel() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn modify_channel() {
|
async fn modify_channel() {
|
||||||
const CHANNEL_NAME: &str = "beepboop";
|
const CHANNEL_NAME: &str = "beepboop";
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
|
@ -91,7 +94,8 @@ async fn modify_channel() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn get_channel_messages() {
|
async fn get_channel_messages() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let channel_id: Snowflake = bundle.channel.read().unwrap().id;
|
let channel_id: Snowflake = bundle.channel.read().unwrap().id;
|
||||||
|
@ -147,7 +151,8 @@ async fn get_channel_messages() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn create_dm() {
|
async fn create_dm() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let other_user = bundle.create_user("integrationtestuser2").await;
|
let other_user = bundle.create_user("integrationtestuser2").await;
|
||||||
|
|
|
@ -10,7 +10,8 @@ use wasm_bindgen_test::*;
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
wasm_bindgen_test_configure!(run_in_browser);
|
wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
/// Tests establishing a connection (hello and heartbeats) on the local gateway;
|
/// Tests establishing a connection (hello and heartbeats) on the local gateway;
|
||||||
async fn test_gateway_establish() {
|
async fn test_gateway_establish() {
|
||||||
let bundle = common::setup().await;
|
let bundle = common::setup().await;
|
||||||
|
@ -19,7 +20,8 @@ async fn test_gateway_establish() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
/// Tests establishing a connection and authenticating
|
/// Tests establishing a connection and authenticating
|
||||||
async fn test_gateway_authenticate() {
|
async fn test_gateway_authenticate() {
|
||||||
let bundle = common::setup().await;
|
let bundle = common::setup().await;
|
||||||
|
@ -33,7 +35,8 @@ async fn test_gateway_authenticate() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn test_self_updating_structs() {
|
async fn test_self_updating_structs() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let received_channel = bundle
|
let received_channel = bundle
|
||||||
|
@ -66,7 +69,8 @@ async fn test_self_updating_structs() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn test_recursive_self_updating_structs() {
|
async fn test_recursive_self_updating_structs() {
|
||||||
// Setup
|
// Setup
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
|
|
|
@ -9,7 +9,8 @@ use wasm_bindgen_test::*;
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
wasm_bindgen_test_configure!(run_in_browser);
|
wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn guild_creation_deletion() {
|
async fn guild_creation_deletion() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
|
|
||||||
|
@ -31,7 +32,8 @@ async fn guild_creation_deletion() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn get_channels() {
|
async fn get_channels() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let guild = bundle.guild.read().unwrap().clone();
|
let guild = bundle.guild.read().unwrap().clone();
|
||||||
|
@ -39,7 +41,8 @@ async fn get_channels() {
|
||||||
common::teardown(bundle).await;
|
common::teardown(bundle).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn guild_create_ban() {
|
async fn guild_create_ban() {
|
||||||
// TODO: When routes exist to check if user x is on guild y, add this as an assertion to check
|
// TODO: When routes exist to check if user x is on guild y, add this as an assertion to check
|
||||||
// if Spacebar actually bans the user.
|
// if Spacebar actually bans the user.
|
||||||
|
@ -76,7 +79,8 @@ async fn guild_create_ban() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn modify_guild() {
|
async fn modify_guild() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let schema = GuildModifySchema {
|
let schema = GuildModifySchema {
|
||||||
|
@ -91,7 +95,8 @@ async fn modify_guild() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn guild_remove_member() {
|
async fn guild_remove_member() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let channel = bundle.channel.read().unwrap().clone();
|
let channel = bundle.channel.read().unwrap().clone();
|
||||||
|
|
|
@ -5,7 +5,8 @@ use wasm_bindgen_test::*;
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
wasm_bindgen_test_configure!(run_in_browser);
|
wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn generate_general_configuration_schema() {
|
async fn generate_general_configuration_schema() {
|
||||||
let bundle = common::setup().await;
|
let bundle = common::setup().await;
|
||||||
bundle
|
bundle
|
||||||
|
|
|
@ -6,7 +6,8 @@ use wasm_bindgen_test::*;
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
wasm_bindgen_test_configure!(run_in_browser);
|
wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn create_accept_invite() {
|
async fn create_accept_invite() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let channel = bundle.channel.read().unwrap().clone();
|
let channel = bundle.channel.read().unwrap().clone();
|
||||||
|
|
|
@ -7,7 +7,8 @@ wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn add_remove_role() -> ChorusResult<()> {
|
async fn add_remove_role() -> ChorusResult<()> {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let guild = bundle.guild.read().unwrap().id;
|
let guild = bundle.guild.read().unwrap().id;
|
||||||
|
|
|
@ -10,7 +10,8 @@ wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn send_message() {
|
async fn send_message() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let message = types::MessageSendSchema {
|
let message = types::MessageSendSchema {
|
||||||
|
@ -22,7 +23,8 @@ async fn send_message() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn send_message_attachment() {
|
async fn send_message_attachment() {
|
||||||
let f = File::open("./README.md").unwrap();
|
let f = File::open("./README.md").unwrap();
|
||||||
let mut reader = BufReader::new(f);
|
let mut reader = BufReader::new(f);
|
||||||
|
@ -59,7 +61,8 @@ async fn send_message_attachment() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn search_messages() {
|
async fn search_messages() {
|
||||||
let f = File::open("./README.md").unwrap();
|
let f = File::open("./README.md").unwrap();
|
||||||
let mut reader = BufReader::new(f);
|
let mut reader = BufReader::new(f);
|
||||||
|
@ -105,7 +108,8 @@ async fn search_messages() {
|
||||||
assert_eq!(query_result.get(0).unwrap().id, message.id);
|
assert_eq!(query_result.get(0).unwrap().id, message.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn test_stickies() {
|
async fn test_stickies() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let message = types::MessageSendSchema {
|
let message = types::MessageSendSchema {
|
||||||
|
|
|
@ -7,7 +7,8 @@ wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn test_get_mutual_relationships() {
|
async fn test_get_mutual_relationships() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let mut other_user = bundle.create_user("integrationtestuser2").await;
|
let mut other_user = bundle.create_user("integrationtestuser2").await;
|
||||||
|
@ -28,7 +29,8 @@ async fn test_get_mutual_relationships() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn test_get_relationships() {
|
async fn test_get_relationships() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let mut other_user = bundle.create_user("integrationtestuser2").await;
|
let mut other_user = bundle.create_user("integrationtestuser2").await;
|
||||||
|
@ -51,7 +53,8 @@ async fn test_get_relationships() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn test_modify_relationship_friends() {
|
async fn test_modify_relationship_friends() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let mut other_user = bundle.create_user("integrationtestuser2").await;
|
let mut other_user = bundle.create_user("integrationtestuser2").await;
|
||||||
|
@ -102,7 +105,8 @@ async fn test_modify_relationship_friends() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn test_modify_relationship_block() {
|
async fn test_modify_relationship_block() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let mut other_user = bundle.create_user("integrationtestuser2").await;
|
let mut other_user = bundle.create_user("integrationtestuser2").await;
|
||||||
|
|
|
@ -7,7 +7,8 @@ wasm_bindgen_test_configure!(run_in_browser);
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn create_and_get_roles() {
|
async fn create_and_get_roles() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let permissions = types::PermissionFlags::CONNECT | types::PermissionFlags::MANAGE_EVENTS;
|
let permissions = types::PermissionFlags::CONNECT | types::PermissionFlags::MANAGE_EVENTS;
|
||||||
|
@ -36,7 +37,8 @@ async fn create_and_get_roles() {
|
||||||
common::teardown(bundle).await
|
common::teardown(bundle).await
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
||||||
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
||||||
async fn get_and_delete_role() {
|
async fn get_and_delete_role() {
|
||||||
let mut bundle = common::setup().await;
|
let mut bundle = common::setup().await;
|
||||||
let guild_id = bundle.guild.read().unwrap().id;
|
let guild_id = bundle.guild.read().unwrap().id;
|
||||||
|
|
Loading…
Reference in New Issue