Skip to content
Permalink
Browse files

feature: added length property

  • Loading branch information
hbarcelos committed Feb 5, 2020
1 parent c69968e commit 791b62c8e4e3124078ca3fc34026d5224c4a798c
Showing with 13 additions and 0 deletions.
  1. +5 −0 round-linked-queue.js
  2. +8 −0 round-linked-queue.test.js
@@ -3,11 +3,16 @@
class RoundLinkedQueue {
constructor(maxLength) {
this._maxLength = maxLength;
this._length = 0;
}

get maxLength() {
return this._maxLength;
}

get length() {
return this._length;
}
}

module.exports = RoundLinkedQueue;
@@ -12,5 +12,13 @@ describe("Round-Queue", () => {

expect(queue.maxLength).to.equal(queueLength);
});

it("Should initially set the length to zero", () => {
const queueLength = 3;

const queue = new RoundQueue(queueLength);

expect(queue.length).to.equal(0);
});
});
});

0 comments on commit 791b62c

Please sign in to comment.
You can’t perform that action at this time.