Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { Repository } = require("./solution");
- const { beforeEach, describe, it } = require("mocha");
- const { expect } = require("chai");
- describe("MyTests", function () {
- let repo;
- let props = {
- name: "string",
- age: "number",
- birthday: "object",
- };
- beforeEach(function () {
- repo = new Repository(props);
- });
- describe("add test", function () {
- it("should set correctly", function () {
- let person = {
- name: "Gosho",
- age: 22,
- birthday: new Date(1998, 0, 7),
- };
- let output = repo.add(person);
- expect(output).to.equal(0, "Returns false value");
- repo.add(person);
- expect(repo.data[0]).to.deep.equal(person);
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement