Skip to content

Commit

Permalink
🧪 More failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dennism501 committed Aug 5, 2021
1 parent 66dfc20 commit 59e8d2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 27 deletions.
2 changes: 1 addition & 1 deletion backend/globalConfig.json
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"}
29 changes: 3 additions & 26 deletions backend/test/services/getAllTodos.test.js
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 () => {});
});

0 comments on commit 59e8d2b

Please sign in to comment.