Commit 9a1648fb authored by Giannis Kepas's avatar Giannis Kepas
Browse files

assignment 2 tests

parent babfef41
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ import getDayType from "../solution_08.js";
import assert from "assert";

describe("solution_08.js", function () {
  describe("getDayType", function () {
  describe("getDayType()", function () {
    it('should return "Weekend" for "Saturday"', function () {
      assert.strictEqual(getDayType("Saturday"), "Weekend");
    });
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ import isEvenExceptTwoOrFour from "../solution_09.js";
import assert from "assert";

describe("solution_09.js", function () {
  describe("#isEvenExceptTwoOrFour()", function () {
  describe("isEvenExceptTwoOrFour()", function () {
    it("should return false for odd numbers", function () {
      [1, 3, 5, 7, 9, 115, 143].forEach((i) => {
        assert.equal(isEvenExceptTwoOrFour(i), false);

test/assignment-2/test_07.js

deleted100644 → 0
+0 −11
Original line number Diff line number Diff line
import integers from "../solution_07.js";
import assert from "assert";

describe("\n\nSolution_07", () => {
  it("should return '[2,3,4,5,6,7,8,9,10]'", () => {
    let res = integers();
    for (let i = 2; i <= 10; i++) {
      assert.equal(res[i - 2], i);
    }
  });
});

test/assignment-2/test_08.js

deleted100644 → 0
+0 −14
Original line number Diff line number Diff line
import primeNumbers from "../solution_08.js";
import assert from "assert";

describe("\n\nSolution_08", () => {
  it("should return correct result for 2", () => {
    assert.deepEqual(primeNumbers(2), [2]);
  });
  it("should return correct result for 10", () => {
    assert.deepEqual(primeNumbers(10), [2,3,5,7]);
  });
  it("should return correct result for 15", () => {
    assert.deepEqual(primeNumbers(15), [2,3,5,7,11,13]);
  });
});

test/assignment-2/test_09.js

deleted100644 → 0
+0 −11
Original line number Diff line number Diff line
import min from "../solution_09.js";
import assert from "assert";

describe("\n\nSolution_09", () => {
  it("should return 2 for min(2,5)", () => {
    assert.equal(min(2, 5), 2);
  });
  it("should return 3 for min(6,3)", () => {
    assert.equal(min(6, 3), 3);
  });
});
Loading