Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit dc310ab

Browse files
3d completed
1 parent 2e36d05 commit dc310ab

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @param {string} val
3+
* @return {Object}
4+
*/
5+
var expect = function (val) {
6+
return {
7+
toBe: function (val2) {
8+
if (typeof val2 === "number" && val === val2) return true;
9+
else throw new Error("Not Equal");
10+
},
11+
notToBe: function (val2) {
12+
if (typeof val2 !== "number" && val !== val2) return true;
13+
else throw new Error("Equal");
14+
},
15+
};
16+
};
17+
18+
/**
19+
* expect(5).toBe(5); // true
20+
* expect(5).notToBe(5); // throws "Equal"
21+
*/

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /