We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3ac1fc commit e2394e7Copy full SHA for e2394e7
test/linked-list.spec.js
@@ -81,6 +81,21 @@ describe('LinkedList', () => {
81
82
expect(list.at(position)).to.equal(data);
83
});
84
+
85
+ it ('shouldn\'t replace existing values', () => {
86
+ const list = new LinkedList();
87
+ const position = 1;
88
+ const data = 42;
89
+ let values = [10, 20];
90
+ values.forEach((value) => { list.append(value) });
91
92
+ list.insertAt(position, data);
93
+ values.splice(position, 0, data);
94
95
+ values.forEach((value, index) => {
96
+ expect(list.at(index)).to.equal(value);
97
+ });
98
99
100
describe('#isEmpty', () => {
101
it('should return true if list is empty', () => {
0 commit comments