Fix typescript not generating ESM and add default values for rust types!
This commit is contained in:
14
src/test.rs
14
src/test.rs
@@ -6,12 +6,12 @@ use std::{
|
||||
|
||||
#[test]
|
||||
fn compare_tools() {
|
||||
let targets = vec!["rust"];
|
||||
let targets = vec!["js-esm"];
|
||||
for target in targets {
|
||||
std::fs::remove_dir_all("./tests").unwrap();
|
||||
std::fs::create_dir_all("./tests").unwrap();
|
||||
|
||||
Command::new("cargo")
|
||||
let result1 = Command::new("cargo")
|
||||
.arg("run")
|
||||
.arg("--")
|
||||
.arg("compile")
|
||||
@@ -26,7 +26,11 @@ fn compare_tools() {
|
||||
.wait()
|
||||
.unwrap();
|
||||
|
||||
Command::new("node")
|
||||
if !result1.success() {
|
||||
panic!("Failed to generate Rust code");
|
||||
}
|
||||
|
||||
let result2 = Command::new("node")
|
||||
.arg("JsonRPC/lib/jrpc.js")
|
||||
.arg("compile")
|
||||
.arg("--verbose")
|
||||
@@ -40,6 +44,10 @@ fn compare_tools() {
|
||||
.wait()
|
||||
.unwrap();
|
||||
|
||||
if !result2.success() {
|
||||
panic!("Failed to generate JavaScript code");
|
||||
}
|
||||
|
||||
let rust_files = walkdir::WalkDir::new("tests/rust")
|
||||
.into_iter()
|
||||
.map(|e| e.unwrap())
|
||||
|
||||
Reference in New Issue
Block a user