aboutsummaryrefslogtreecommitdiffstats
path: root/2704/main.js
blob: db4d727d100192ed55828d6664f8088e807abe41 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env node
"use strict";

var expect = function (val) {
  var object = {
    toBe: function (except) {
      if (except === val) {
        return true;
      } else {
        throw "Not Equal";
      }
    },
    notToBe: function (except) {
      if (except !== val) {
        return true;
      } else {
        throw "Equal";
      }
    },
  };
  return object;
};

console.log(expect(5).toBe(5)); // true
console.log(expect(5).notToBe(5)); // throws "Equal"