Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(wasm): clean up split-up build #3407

Merged
merged 4 commits into from
Nov 22, 2023
Merged

Conversation

TalDerei
Copy link
Collaborator

@TalDerei TalDerei commented Nov 17, 2023

References #3406.

For testing purposes, we can conditionally mock a sample IdbDatabase database using the mock-database feature. This enables stripping out unnecessary business logic from the production code. The command to run the test suite is wasm-pack test --chrome -- --test test_build --target wasm32-unknown-unknown --release --features "mock-database" inside the wasm package.


[dev-dependencies]
wasm-bindgen-test = "0.3.37"
wasm-bindgen-test = "0.3.37"
serde_json = "1.0.107"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new line

@@ -41,7 +43,16 @@ impl IndexedDBStorage {
pub async fn new(constants: IndexedDbConstants) -> WasmResult<Self> {
let mut db_req: OpenDbRequest = IdbDatabase::open_u32(&constants.name, constants.version)?;

// Conditionally create object stores in the `IdbDatabase` database for testing purposes
// Conditionally mock sample `IdbDatabase` database for testing purposes
#[cfg(feature = "mock-database")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, nice call with the feature flag

@TalDerei TalDerei marked this pull request as ready for review November 17, 2023 21:31
@TalDerei TalDerei self-assigned this Nov 18, 2023
@TalDerei TalDerei merged commit 35e1b46 into main Nov 22, 2023
6 checks passed
@TalDerei TalDerei deleted the tx-decompose-comments branch November 22, 2023 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants