Skip to content

Commit

Permalink
Add rust test to check if appdata is created
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Mellin committed Feb 2, 2024
1 parent a2654a0 commit b3436ce
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/webdriver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,4 @@ jobs:
- name: WebdriverIO
run: xvfb-run npm test
working-directory: webdriver/webdriverio
env:
DATABASE_URL: ./test.sqlite

4 changes: 4 additions & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ libsqlite3-sys = { version = ">=0.17.2, <0.28.0", features = ["bundled"] }
# this feature is used for production builds or when `devPath` points to the filesystem
# DO NOT REMOVE!!
custom-protocol = ["tauri/custom-protocol"]

[lib]
name = "goel"
path = "src/lib.rs"
2 changes: 2 additions & 0 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod db;
pub mod config;
14 changes: 14 additions & 0 deletions src-tauri/tests/os.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use std::fs;

use goel::db::establish_connection;
use goel::config;

#[test]
fn user_app_cache_created_when_init_db() {
let cfg: crate::config::GoelConfig = confy::load("goel", None).unwrap();
let db_dir = cfg.db_dir;

establish_connection().unwrap();

assert!(fs::metadata(db_dir).unwrap().is_dir());
}

0 comments on commit b3436ce

Please sign in to comment.