Fix typescript not generating ESM and add default values for rust types!

This commit is contained in:
Fabian Stamm
2025-12-09 17:48:44 +01:00
parent b069237b91
commit ef8e97b15a
8 changed files with 33 additions and 14 deletions

View File

@@ -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())