-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
125 lines (105 loc) · 2.06 KB
/
test.js
File metadata and controls
125 lines (105 loc) · 2.06 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
var chai = require('chai'),
expect = chai.expect,
Sort = require('./');
chai.should();
describe("In the sort class,", function () {
var sort,
array = [1, 3, 6, 2, 5, 4];
beforeEach(function () {
sort = new Sort(array);
});
it("Should...", function () {
expect(sort.result).to.be.undefined;
});
it("Should...", function () {
sort.steps.should.deep.equal([]);
});
});
describe("TODO B", function () {
var sort,
array = [1, 3, 6, 2, 5, 4];
beforeEach(function () {
sort = new Sort(array);
sort.compute();
});
it("Should...", function () {
sort.array.should.deep.equal(array);
});
it("Should...", function () {
sort.result.should.deep.equal([1, 2, 3, 4, 5, 6]);
});
it("Should 3..", function () {
sort.getStep(3).should.deep.equal({
array: [1, 3, 2, 5, 6, 4],
selected: 4
});
});
it("Should 6...", function () {
sort.getStep(6).should.deep.equal({
array: [1, 2, 3, 5, 4, 6],
selected: 2
});
});
it("Should 9...", function () {
sort.getStep(9).should.deep.equal({
array: [1, 2, 3, 4, 5, 6],
selected: 5
});
});
it("Should...", function () {
expect(sort.getStep(20)).to.be.undefined;
});
it("Should...", function () {
console.log(sort.steps);
});
});
describe("TODO C", function () {
var sort,
array = [1, 3, 6, 2, 5, 4];
beforeEach(function () {
sort = new Sort(array);
});
it("Should...", function () {
sort.next().should.deep.equal({
value: {
array: [1, 3, 6, 2, 5, 4],
selected: 1
},
done: false
});
});
it("Should...", function () {
sort.next();
sort.next().should.deep.equal({
value: {
array: [1, 3, 6, 2, 5, 4],
selected: 2
},
done: false
});
});
it("Should...", function () {
sort.next();
sort.next();
sort.next().should.deep.equal({
value: {
array: [1, 3, 2, 6, 5, 4],
selected: 3
},
done: false
});
});
it("Should...", function () {
sort.next();
sort.next();
sort.next();
sort.next();
sort.next().should.deep.equal({
value: {
array: [1, 3, 2, 5, 4, 6],
selected: 5
},
done: false
});
});
});