-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; | ||
"# | ||
); | ||
|
||
} |