@@ -3,7 +3,7 @@ import {transpileSql} from "../src/sql.js";
3
3
4
4
describe ( "transpileSql(content, attributes)" , ( ) => {
5
5
it ( "compiles a sql expression" , ( ) => {
6
- assert . strictEqual ( transpileSql ( "SELECT 1 + 2" ) , "display(Inputs.table(await sql`SELECT 1 + 2`));" ) ;
6
+ assert . strictEqual ( transpileSql ( "SELECT 1 + 2" ) , "display(Inputs.table(await sql`SELECT 1 + 2`, {select: false} ));" ) ; // prettier-ignore
7
7
} ) ;
8
8
it ( "compiles a sql expression with id" , ( ) => {
9
9
assert . strictEqual ( transpileSql ( "SELECT 1 + 2" , { id : "foo" } ) , "const foo = await sql`SELECT 1 + 2`;" ) ;
@@ -22,13 +22,13 @@ describe("transpileSql(content, attributes)", () => {
22
22
assert . throws ( ( ) => transpileSql ( "SELECT 1 + 2" , { id : "([foo])" } ) , / i n v a l i d b i n d i n g / ) ;
23
23
} ) ;
24
24
it ( "compiles a sql expression with id and display" , ( ) => {
25
- assert . strictEqual ( transpileSql ( "SELECT 1 + 2" , { id : "foo" , display : "" } ) , "const foo = ((_) => (display(Inputs.table(_)), _))(await sql`SELECT 1 + 2`);" ) ; // prettier-ignore
25
+ assert . strictEqual ( transpileSql ( "SELECT 1 + 2" , { id : "foo" , display : "" } ) , "const foo = ((_) => (display(Inputs.table(_, {select: false} )), _))(await sql`SELECT 1 + 2`);" ) ; // prettier-ignore
26
26
} ) ;
27
27
it ( "ignores display if display is implicit" , ( ) => {
28
- assert . strictEqual ( transpileSql ( "SELECT 1 + 2" , { display : "" } ) , "display(Inputs.table(await sql`SELECT 1 + 2`));" ) ; // prettier-ignore
29
- assert . strictEqual ( transpileSql ( "SELECT 1 + 2" , { display : "t" } ) , "display(Inputs.table(await sql`SELECT 1 + 2`));" ) ; // prettier-ignore
30
- assert . strictEqual ( transpileSql ( "SELECT 1 + 2" , { display : "f" } ) , "display(Inputs.table(await sql`SELECT 1 + 2`));" ) ; // prettier-ignore
31
- assert . strictEqual ( transpileSql ( "SELECT 1 + 2" , { display : "true" } ) , "display(Inputs.table(await sql`SELECT 1 + 2`));" ) ; // prettier-ignore
28
+ assert . strictEqual ( transpileSql ( "SELECT 1 + 2" , { display : "" } ) , "display(Inputs.table(await sql`SELECT 1 + 2`, {select: false} ));" ) ; // prettier-ignore
29
+ assert . strictEqual ( transpileSql ( "SELECT 1 + 2" , { display : "t" } ) , "display(Inputs.table(await sql`SELECT 1 + 2`, {select: false} ));" ) ; // prettier-ignore
30
+ assert . strictEqual ( transpileSql ( "SELECT 1 + 2" , { display : "f" } ) , "display(Inputs.table(await sql`SELECT 1 + 2`, {select: false} ));" ) ; // prettier-ignore
31
+ assert . strictEqual ( transpileSql ( "SELECT 1 + 2" , { display : "true" } ) , "display(Inputs.table(await sql`SELECT 1 + 2`, {select: false} ));" ) ; // prettier-ignore
32
32
} ) ;
33
33
it ( "compiles a sql expression with display=false" , ( ) => {
34
34
assert . strictEqual ( transpileSql ( "SELECT 1 + 2" , { display : "false" } ) , "sql`SELECT 1 + 2`;" ) ;
0 commit comments