diff --git a/controllers/club.js b/controllers/club.js index d7fd196..40f6b4c 100644 --- a/controllers/club.js +++ b/controllers/club.js @@ -1,10 +1,14 @@ import Clubs from "../models/Clubs.js"; export const createClub = async (req, res,next) => { - const club = new Clubs(req.body); - try { - const saveClub = await club.save(); - res.status(200).json(saveClub); + describe("Post Endpoints", () => { + it("should create a new post", async () => { + const saveClub = await club.save(); + res.status(200).json(saveClub); + }); + expect(res.statusCode).toEqual(201); + expect(res.body).toHaveProperty("post"); + }); } catch (err) { next(err); }