Skip to content

Commit

Permalink
Add some tests to core crate (#613)
Browse files Browse the repository at this point in the history
Signed-off-by: Sergio Castaño Arteaga <[email protected]>
  • Loading branch information
tegioz authored May 3, 2024
1 parent e4115ea commit 2e23e04
Show file tree
Hide file tree
Showing 16 changed files with 2,631 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.77.0
toolchain: 1.78.0
components: clippy, rustfmt
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
crates/wasm/overlay/data
crates/wasm/overlay/dist
crates/wasm/overlay/sources
lcov.info
npm-debug.log*
target
target-wasm
Expand Down
71 changes: 71 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ markdown = "1.0.0-alpha.17"
md-5 = "0.10.6"
mime_guess = "2.0.4"
mockall = "0.12.1"
mockito = "1.4.0"
num_cpus = "1.16.0"
octorust = "0.7.0"
parse_link_header = "0.3.3"
pretty_assertions = "1.4.0"
qrcode = "0.14.0"
regex = "1.10.4"
reqwest = { version = "0.12.4", features = ["json", "native-tls-vendored"] }
Expand Down
24 changes: 12 additions & 12 deletions crates/cli/src/build/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,26 +97,26 @@ impl From<&data::Item> for Item {

// Crunchbase values
if let Some(organization) = &di.crunchbase_data {
item.crunchbase_city = organization.city.clone();
item.crunchbase_country = organization.country.clone();
item.crunchbase_description = organization.description.clone();
item.crunchbase_homepage = organization.homepage_url.clone();
item.crunchbase_kind = organization.kind.clone();
item.crunchbase_linkedin = organization.linkedin_url.clone();
item.crunchbase_city.clone_from(&organization.city);
item.crunchbase_country.clone_from(&organization.country);
item.crunchbase_description.clone_from(&organization.description);
item.crunchbase_homepage.clone_from(&organization.homepage_url);
item.crunchbase_kind.clone_from(&organization.kind);
item.crunchbase_linkedin.clone_from(&organization.linkedin_url);
item.crunchbase_max_employees = organization.num_employees_max;
item.crunchbase_min_employees = organization.num_employees_min;
item.crunchbase_region = organization.region.clone();
item.crunchbase_ticker = organization.ticker.clone();
item.crunchbase_twitter = organization.twitter_url.clone();
item.crunchbase_region.clone_from(&organization.region);
item.crunchbase_ticker.clone_from(&organization.ticker);
item.crunchbase_twitter.clone_from(&organization.twitter_url);
item.funding = organization.funding;
item.organization = organization.name.clone();
item.organization.clone_from(&organization.name);
}

// Twitter
if di.twitter_url.is_some() {
item.twitter = di.twitter_url.clone();
item.twitter.clone_from(&di.twitter_url);
} else if item.crunchbase_twitter.is_some() {
item.twitter = item.crunchbase_twitter.clone();
item.twitter.clone_from(&item.crunchbase_twitter);
}

// Relation
Expand Down
5 changes: 5 additions & 0 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ serde = { workspace = true }
serde_yaml = { workspace = true }
tracing = { workspace = true }
url = { workspace = true }

[dev-dependencies]
mockito = { workspace = true }
pretty_assertions = { workspace = true }
tokio = { workspace = true }
Loading

0 comments on commit 2e23e04

Please sign in to comment.