-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanagram.spec.js
More file actions
25 lines (25 loc) · 1.04 KB
/
anagram.spec.js
File metadata and controls
25 lines (25 loc) · 1.04 KB
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
(function () {
"use strict";
describe("Anagram", function () {
beforeEach(function () {
this.anagramFinder = new Anagram();
});
it("should be instantiable", function () {
expect(this.anagramFinder).toBeTruthy();
});
describe("find", function () {
it("should be a function", function () {
expect(_.isFunction(this.anagramFinder.find)).toBeTruthy();
});
it("should return an empty Array", function () {
expect(this.anagramFinder.find()).toEqual([]);
});
it("should return an empty Array", function () {
expect(this.anagramFinder.find("meat", "mat", "team", "mate", "eat")).toEqual([["meat", "team", "mate"]]);
});
it("should return an empty Array", function () {
expect(this.anagramFinder.find("veer", "lake", "item", "kale", "mite", "ever")).toEqual([["veer", "ever"], ["lake", "kale"], ["item", "mite"]]);
});
});
});
})();