-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66dfc20
commit 59e8d2b
Showing
2 changed files
with
4 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"mongoUri":"mongodb://127.0.0.1:58812/","mongoDBName":"jest"} | ||
{"mongoUri":"mongodb://127.0.0.1:55540/","mongoDBName":"jest"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,7 @@ | ||
const todoService = require("../../src/services/todo"); | ||
const { MongoClient } = require("mongodb"); | ||
const database = require("../../src/database/database"); | ||
|
||
describe("✅ Tests the service layer", () => { | ||
let connection; | ||
let db; | ||
|
||
beforeAll(async () => { | ||
connection = await MongoClient.connect(global.__MONGO_URI__, { | ||
useNewUrlParser: true, | ||
useUnifiedTopology: true, | ||
}); | ||
db = await connection.db(global.__MONGO_DB_NAME__); | ||
}); | ||
|
||
afterAll(async () => { | ||
//await connection.close(); | ||
}); | ||
|
||
const todo = todoService(connection); | ||
const querysArgs = { | ||
page: 0, | ||
pageSize: 20, | ||
dueDate: "", | ||
}; | ||
it("OK, Get all todos from empty collection", () => { | ||
const todos = todo.getAllTodos(querysArgs.page, querysArgs.pageSize); | ||
expect(todos).toEqual([]); | ||
}); | ||
const todo = todoService(database); | ||
it("OK, Get all todos from empty collection", async () => {}); | ||
}); |