|
| 1 | +import SQL from '.' |
| 2 | +import { glue, map, SqlStatement } from '.' |
| 3 | +import { expect } from 'tstyche' |
| 4 | + |
| 5 | +expect(SQL`SELECT 1`).type.toBe<SqlStatement>() |
| 6 | +expect(SQL`SELECT 1`).type.toBe<SQL.SqlStatement>() |
| 7 | +expect(SQL`SELECT `.append(SQL`1`)).type.toBe<SqlStatement>() |
| 8 | +expect(SQL`SELECT `.append(SQL`1`)).type.toBe<SQL.SqlStatement>() |
| 9 | +expect(glue([SQL`SELECT`, SQL`1`], ' ')).type.toBe<SqlStatement>() |
| 10 | +expect(SQL.glue([SQL`SELECT`, SQL`1`], ' ')).type.toBe<SQL.SqlStatement>() |
| 11 | +expect(SQL.map([1, 2, 3])).type.toBe<SQL.SqlStatement>() |
| 12 | +expect(SQL.map([1, 2, 3], x => x ** 2)).type.toBe<SQL.SqlStatement>() |
| 13 | +expect(map([1, 2, 3])).type.toBe<SQL.SqlStatement>() |
| 14 | +expect(map([1, 2, 3], x => x ** 2)).type.toBe<SQL.SqlStatement>() |
| 15 | +expect(SQL`SELECT 1`.debug).type.toBe<string>() |
| 16 | +expect(SQL`SELECT 1`.sql).type.toBe<string>() |
| 17 | +expect(SQL`SELECT 1`.text).type.toBe<string>() |
| 18 | +expect(SQL.unsafe('string')).type.toBe<{ value: string }>() |
| 19 | +expect(SQL.unsafe(1)).type.toBe<{ value: number }>() |
| 20 | +expect(SQL.quoteIdent('string')).type.toBe<{ value: string }>() |
| 21 | +expect(SQL`SELECT `.append).type.not.toBeCallableWith(`1`) |
0 commit comments