Skip to content

Commit

Permalink
camelcase test
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonShin committed Oct 31, 2023
1 parent 8ac0b6f commit ad17639
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions tests/covert_to_camelcase.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#[cfg(test)]
mod string_functions_tests {
use assert_cmd::prelude::*;
use predicates::prelude::*;
use std::fs;
use std::io::Write;
use std::process::Command;
use tempfile::tempdir;

use pretty_assertions::assert_eq;
use test_utils::test_utils::TSString;
use test_utils::{run_test, sandbox::TestConfig};

#[rustfmt::skip]
run_test!(camelcase, TestConfig::new("postgres"),

//// TS query ////
r#"
const someQuery = sql`
SELECT
id AS hello_world1,
id AS helloWorld2,
id AS HelloWorld3
FROM items;
`
"#,

//// Generated TS interfaces ////
r#"
export type SomeQueryParams = [];
export interface ISomeQueryResult {
helloWorld1: number;
helloWorld2: number;
helloWorld3: number;
};
export interface ISomeQueryQuery {
params: SomeQueryParams;
result: ISomeQueryResult;
};
"#
);

}

0 comments on commit ad17639

Please sign in to comment.