mirror of
https://github.com/Noratrieb/haesli.git
synced 2026-01-14 19:55:03 +01:00
send message!
This commit is contained in:
parent
b50634841d
commit
99ce586dec
8 changed files with 169 additions and 66 deletions
|
|
@ -1,9 +1,25 @@
|
|||
use crate::project_root;
|
||||
use anyhow::{bail, Context, Result};
|
||||
use std::process::Command;
|
||||
use std::path::Path;
|
||||
use std::process::{Command, Stdio};
|
||||
|
||||
pub fn main() -> Result<()> {
|
||||
let test_js_root = project_root().join("test-js");
|
||||
let project_root = project_root();
|
||||
let test_js_root = project_root.join("test-js");
|
||||
|
||||
let mut amqp_server = Command::new("cargo")
|
||||
.arg("run")
|
||||
.spawn()
|
||||
.context("`cargo run` amqp")?;
|
||||
|
||||
let test_result = run_js(&test_js_root);
|
||||
|
||||
amqp_server.kill()?;
|
||||
|
||||
test_result
|
||||
}
|
||||
|
||||
fn run_js(test_js_root: &Path) -> Result<()> {
|
||||
let status = Command::new("yarn")
|
||||
.current_dir(&test_js_root)
|
||||
.status()
|
||||
|
|
@ -16,9 +32,9 @@ pub fn main() -> Result<()> {
|
|||
.current_dir(&test_js_root)
|
||||
.status()
|
||||
.context("yarn test tests")?;
|
||||
|
||||
if !status.success() {
|
||||
bail!("yarn tests failed");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue