Skip to content

Commit 7fe0016

Browse files
author
Sylvestre Gug
committed
prettier table-test.mjs
1 parent 333beef commit 7fe0016

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

test/table-test.mjs

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ describe("makeQueryTemplate", () => {
122122
};
123123

124124
const [parts, ...params] = makeQueryTemplate(operations, source);
125-
assert.deepStrictEqual(parts.join("?"), "SELECT t._col1_,t._col2_ FROM table1 t\nWHERE t._col2_ = ?");
125+
assert.deepStrictEqual(
126+
parts.join("?"),
127+
"SELECT t._col1_,t._col2_ FROM table1 t\nWHERE t._col2_ = ?"
128+
);
126129
assert.deepStrictEqual(params, ["val1"]);
127130
});
128131

@@ -195,7 +198,10 @@ describe("makeQueryTemplate", () => {
195198
};
196199

197200
const [parts, ...params] = makeQueryTemplate(operations, source);
198-
assert.deepStrictEqual(parts.join("?"), "SELECT t._col1_,t._col2_ FROM table1 t\nORDER BY t._col1_ ASC, t._col2_ DESC");
201+
assert.deepStrictEqual(
202+
parts.join("?"),
203+
"SELECT t._col1_,t._col2_ FROM table1 t\nORDER BY t._col1_ ASC, t._col2_ DESC"
204+
);
199205
assert.deepStrictEqual(params, []);
200206
});
201207

@@ -247,12 +253,15 @@ describe("makeQueryTemplate", () => {
247253
};
248254

249255
const [parts, ...params] = makeQueryTemplate(operations, source);
250-
assert.deepStrictEqual(parts.join("?"), "SELECT t.col1,t.col2,t.col3 FROM table1 t\nWHERE t.col1 >= ?\nAND t.col2 = ?\nORDER BY t.col1 ASC\nLIMIT 90 OFFSET 10");
256+
assert.deepStrictEqual(
257+
parts.join("?"),
258+
"SELECT t.col1,t.col2,t.col3 FROM table1 t\nWHERE t.col1 >= ?\nAND t.col2 = ?\nORDER BY t.col1 ASC\nLIMIT 90 OFFSET 10"
259+
);
251260
assert.deepStrictEqual(params, ["val1", "val2"]);
252261
});
253262

254263
it("makeQueryTemplate select, slice and escape column name with mssql syntax", () => {
255-
const source = {name: "db", dialect: "mssql", escape: (i) => `_${i}_`};
264+
const source = {name: "db", dialect: "mssql", escape: (i) => `_${i}_`};
256265
const operations = {
257266
...baseOperations,
258267
select: {
@@ -262,7 +271,10 @@ describe("makeQueryTemplate", () => {
262271
};
263272

264273
const [parts] = makeQueryTemplate(operations, source);
265-
assert.deepStrictEqual(parts.join("?"), "SELECT t._col1_,t._col2_,t._col3_ FROM table1 t\nORDER BY t._col1_ ASC\nOFFSET 0 ROWS\nFETCH NEXT 100 ROWS ONLY");
274+
assert.deepStrictEqual(
275+
parts.join("?"),
276+
"SELECT t._col1_,t._col2_,t._col3_ FROM table1 t\nORDER BY t._col1_ ASC\nOFFSET 0 ROWS\nFETCH NEXT 100 ROWS ONLY"
277+
);
266278
});
267279

268280
it("makeQueryTemplate select, sort, slice, filter indexed with mssql syntax", () => {
@@ -323,8 +335,8 @@ describe("makeQueryTemplate", () => {
323335
}
324336
]
325337
};
326-
327-
assert.throws(() =>{
338+
339+
assert.throws(() => {
328340
makeQueryTemplate(operations, source);
329341
}, Error);
330342
});

0 commit comments

Comments
 (0)