Skip to content

Commit c69968e

Browse files
committed
feature: added maxLength property
1 parent ce31f3a commit c69968e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

round-linked-queue.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
"use strict";
22

33
class RoundLinkedQueue {
4+
constructor(maxLength) {
5+
this._maxLength = maxLength;
6+
}
7+
8+
get maxLength() {
9+
return this._maxLength;
10+
}
411
}
512

613
module.exports = RoundLinkedQueue;

round-linked-queue.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,13 @@ const expect = chai.expect;
44
const RoundQueue = require("./round-linked-queue");
55

66
describe("Round-Queue", () => {
7+
describe("When creating an instance", () => {
8+
it("Should properly set the maxLength property", () => {
9+
const queueLength = 3;
10+
11+
const queue = new RoundQueue(queueLength);
12+
13+
expect(queue.maxLength).to.equal(queueLength);
14+
});
15+
});
716
});

0 commit comments

Comments
 (0)