You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
expect(result[0].query).to.equal("SELECT cli.internalKey AS internalKey, cli.codeImport AS codeImport, cli.razaoSocial AS razaoSocial, cli.apelido AS apelido, cli.desativo AS desativo, cli.cidade_codeImport AS cidade_codeImport, cli.classificacao_codeImport AS classificacao_codeImport FROM Cliente AS cli WHERE cli.apelido = ? AND cli.codeImport > ? AND cli.desativo <> ?");
Copy file name to clipboardExpand all lines: src/test/where.spec.ts
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,22 @@ describe("Where", () => {
28
28
expect(result[0].query).to.equal("SELECT tes.internalKey AS internalKey, tes.id AS id, tes.description AS description, tes.date AS date, tes.dateMoment AS dateMoment, tes.dateDate AS dateDate, tes.numero AS numero, tes.referenceTest_id AS referenceTest_id, tes.referenceTestCode_code AS referenceTestCode_code FROM TestClazz AS tes WHERE tes.id = ?");
29
29
});
30
30
31
+
it("value type string",()=>{
32
+
constquery=crud.query(TestClazz);
33
+
constparam1: string="abc";
34
+
constparam2: string="102";
35
+
query.where(where=>{
36
+
where.equal(x=>x.description,param1);
37
+
where.equal(x=>x.description,param2);
38
+
});
39
+
constresult=query.compile();
40
+
console.log(result);
41
+
expect(result[0].params.length).to.equal(2);
42
+
expect(result[0].params[0]).to.equal(param1);
43
+
expect(result[0].params[1]).to.equal(param2);
44
+
expect(result[0].query).to.equal("SELECT tes.internalKey AS internalKey, tes.id AS id, tes.description AS description, tes.date AS date, tes.dateMoment AS dateMoment, tes.dateDate AS dateDate, tes.numero AS numero, tes.referenceTest_id AS referenceTest_id, tes.referenceTestCode_code AS referenceTestCode_code FROM TestClazz AS tes WHERE tes.description = ? AND tes.description = ?");
0 commit comments