Advertisement
HariNikolov

Untitled

Apr 4th, 2020
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const { Repository } = require("./solution");
  2. const { beforeEach, describe, it } = require("mocha");
  3. const { expect } = require("chai");
  4.  
  5. describe("MyTests", function () {
  6.   let repo;
  7.   let props = {
  8.     name: "string",
  9.     age: "number",
  10.     birthday: "object",
  11.   };
  12.   beforeEach(function () {
  13.     repo = new Repository(props);
  14.   });
  15.   describe("add test", function () {
  16.     it("should set correctly", function () {
  17.       let person = {
  18.         name: "Gosho",
  19.         age: 22,
  20.         birthday: new Date(1998, 0, 7),
  21.       };
  22.       let output = repo.add(person);
  23.       expect(output).to.equal(0, "Returns false value");
  24.       repo.add(person);
  25.       expect(repo.data[0]).to.deep.equal(person);
  26.     });
  27.   });
  28. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement