Skip to content

Commit ebcdab3

Browse files
authored
(chore) add boolean data type test (FIR-16857) (#35)
1 parent b67878d commit ebcdab3

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

test/integration/boolean.test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { Firebolt } from "../../src/index";
2+
3+
const connectionParams = {
4+
auth: {
5+
username: process.env.FIREBOLT_USERNAME as string,
6+
password: process.env.FIREBOLT_PASSWORD as string
7+
},
8+
database: process.env.FIREBOLT_DATABASE as string,
9+
engineName: process.env.FIREBOLT_ENGINE_NAME as string
10+
};
11+
12+
jest.setTimeout(100000);
13+
14+
describe("boolean", () => {
15+
it("handles select boolean", async () => {
16+
const firebolt = Firebolt({
17+
apiEndpoint: process.env.FIREBOLT_API_ENDPOINT as string
18+
});
19+
20+
const connection = await firebolt.connect(connectionParams);
21+
22+
const statement = await connection.execute("select true::boolean", {
23+
settings: {
24+
advanced_mode: "true",
25+
bool_output_format: "postgres",
26+
output_format_firebolt_type_names: "true"
27+
}
28+
});
29+
30+
const { data, meta } = await statement.fetchResult();
31+
expect(meta[0].type).toEqual("boolean");
32+
const row = data[0];
33+
expect((row as unknown[])[0]).toEqual(true);
34+
});
35+
});

0 commit comments

Comments
 (0)