|
1 | | -import { InsertQueryBuilder } from "../src/query-builder/insert"; |
2 | | -import { SqlExecutor } from "../src/types/common"; |
| 1 | +import {InsertQueryBuilder, SqlExecutor} from "../src"; |
3 | 2 |
|
4 | 3 | // Mock SqlExecutor |
5 | 4 | const mockExecutor: SqlExecutor = { |
@@ -132,40 +131,33 @@ describe("InsertQueryBuilder", () => { |
132 | 131 | // lastName: "Doe", |
133 | 132 | // dateOfBirth: "1990-01-01", |
134 | 133 | // }; |
135 | | - |
136 | 134 | // const result = builder.values(data).build(); |
137 | | - |
138 | 135 | // expect(result.sql).toContain( |
139 | 136 | // '"first_name", "last_name", "date_of_birth"' |
140 | 137 | // ); |
141 | 138 | // }); |
142 | 139 | // }); |
143 | 140 |
|
144 | | - // describe("Value Placeholders", () => { |
145 | | - // it("should generate correct placeholders for values", () => { |
146 | | - // const data = { |
147 | | - // firstName: "John", |
148 | | - // lastName: "Doe", |
149 | | - // age: 30, |
150 | | - // }; |
151 | | - |
152 | | - // const result = builder.values(data).build(); |
153 | | - |
154 | | - // expect(result.sql).toContain("VALUES ($1, $2, $3)"); |
155 | | - // expect(result.values).toEqual(["John", "Doe", 30]); |
156 | | - // }); |
157 | | - |
158 | | - // it("should handle null values correctly", () => { |
159 | | - // const data = { |
160 | | - // firstName: "John", |
161 | | - // lastName: null, |
162 | | - // age: 30, |
163 | | - // }; |
164 | | - |
165 | | - // const result = builder.values(data).build(); |
166 | | - |
167 | | - // expect(result.sql).toContain("VALUES ($1, $2, $3)"); |
168 | | - // expect(result.values).toEqual(["John", null, 30]); |
169 | | - // }); |
170 | | - // }); |
| 141 | + describe("Value Placeholders", () => { |
| 142 | + it("should generate correct placeholders for values", () => { |
| 143 | + const data = { |
| 144 | + firstName: "John", |
| 145 | + lastName: "Doe", |
| 146 | + age: 30, |
| 147 | + }; |
| 148 | + const result = builder.values(data).build(); |
| 149 | + expect(result.sql).toContain("VALUES ($1, $2, $3)"); |
| 150 | + expect(result.values).toEqual(["John", "Doe", 30]); |
| 151 | + }); |
| 152 | + it("should handle null values correctly", () => { |
| 153 | + const data = { |
| 154 | + firstName: "John", |
| 155 | + lastName: null, |
| 156 | + age: 30, |
| 157 | + }; |
| 158 | + const result = builder.values(data).build(); |
| 159 | + expect(result.sql).toContain("VALUES ($1, $2, $3)"); |
| 160 | + expect(result.values).toEqual(["John", null, 30]); |
| 161 | + }); |
| 162 | + }); |
171 | 163 | }); |
0 commit comments