Skip to content

Commit

Permalink
wasm-bindgen test runs in web worker!
Browse files Browse the repository at this point in the history
  • Loading branch information
insipx committed Jul 25, 2024
1 parent d145da6 commit f374b7e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion diesel-wasm-sqlite/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use diesel::{
result::QueryResult,
row::Field,
};
use diesel_async::{AnsiTransactionManager, AsyncConnection, SimpleAsyncConnection};
pub use diesel_async::{AnsiTransactionManager, AsyncConnection, SimpleAsyncConnection};
use futures::stream::Stream;
use std::{
marker::PhantomData,
Expand Down
1 change: 0 additions & 1 deletion diesel-wasm-sqlite/src/connection/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,5 +602,4 @@ extern "C" fn destroy_boxed<F>(data: *mut libc::c_void) {
let ptr = data as *mut F;
unsafe { std::mem::drop(Box::from_raw(ptr)) };
}
*/
Binary file removed diesel-wasm-sqlite/src/wa-sqlite.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions diesel-wasm-sqlite/tests/web.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![cfg(target_arch = "wasm32")]

use diesel::connection::Connection;
use diesel_wasm_sqlite::rust_establish;
use diesel_wasm_sqlite::connection::{AsyncConnection, WasmSqliteConnection};
use wasm_bindgen_test::*;
use web_sys::console;
wasm_bindgen_test_configure!(run_in_dedicated_worker);
Expand All @@ -15,7 +15,7 @@ async fn test_establish() {
rng
);
*/
let mut conn = rust_establish("test").await.unwrap();
let mut conn = WasmSqliteConnection::establish("test").await.unwrap();
console::log_1(&"CONNECTED".into());
// assert 1 == 2 is here b/c can't get --nocapture to work yet
assert_eq!(1, 2);
Expand Down

0 comments on commit f374b7e

Please sign in to comment.