Skip to content

Commit 9bd238e

Browse files
committed
Add @faker-js/faker as a devDependency and refactor tests to use new setup. Remove deprecated setup.ts file and enhance repository tests with additional comparison and logical operators.
1 parent 47dfe96 commit 9bd238e

File tree

11 files changed

+655
-128
lines changed

11 files changed

+655
-128
lines changed

__tests__/repository/count.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Repository } from "../../src/repository/repository";
22
import { eq, gt, and, like } from "../../src";
3-
import { executor, setupTestTables, cleanupTestData } from "../setup";
3+
import { executor, setupTestTables, cleanupTestData } from "../../test-setup";
44

55
interface User {
66
id: number;
@@ -28,9 +28,9 @@ describe("Repository count", () => {
2828
["John Doe", "[email protected]", 30, "Jane Doe", "[email protected]", 25]
2929
);
3030

31-
const result = await repository.count(eq("id", 1));
31+
const result = await repository.count(like("name", "%Doe%"));
3232

33-
expect(result).toBe(1);
33+
expect(result).toBe(2);
3434
});
3535

3636
it("should count rows with condition", async () => {
@@ -41,7 +41,6 @@ describe("Repository count", () => {
4141
);
4242

4343
const result = await repository.count(gt("age", 25));
44-
console.log({result})
4544

4645
expect(result).toBe(1);
4746
});

__tests__/repository/find-row.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Repository } from "../../src/repository/repository";
22
import { eq, and, gt, like } from "../../src";
3-
import { executor, setupTestTables, cleanupTestData } from "../setup";
3+
import { executor, setupTestTables, cleanupTestData } from "../../test-setup";
44

55
interface User {
66
id: number;

0 commit comments

Comments
 (0)