From 9fcda4f1f079ccc86b90509cfca5be1069910bac Mon Sep 17 00:00:00 2001 From: AlaaSaadeddin <“alaa.swaireh@gmail.com”> Date: Tue, 31 Mar 2020 16:21:02 +0300 Subject: [PATCH] edit the route test relates #14 --- server/controllers/index.js | 6 +++--- test/index.test.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/controllers/index.js b/server/controllers/index.js index 05e6d4db..0269ba1b 100644 --- a/server/controllers/index.js +++ b/server/controllers/index.js @@ -1,6 +1,6 @@ -const Router = require('express').Router(); +const router = require('express').Router(); const userRouter = require('./routes/user'); -Router.use(userRouter); +router.use(userRouter); -module.exports = Router; +module.exports = router; diff --git a/test/index.test.js b/test/index.test.js index b8cab4d0..488713d9 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -15,7 +15,7 @@ afterAll(() => { }); describe('Cohort', () => { - test('Route /cohorts status 200, json header, data.id = data.id', (done) => { + test('Route /cohorts status 200, json header, data', (done) => { return request(app) .get('/api/v1/cohorts') .expect(200) @@ -23,7 +23,7 @@ describe('Cohort', () => { .end((err, res) => { if (err) return done(err); const { data } = res.body; - expect(data.id).toBe(data.id); + expect(data).toHaveLength(2); done(); }); });