Skip to content
Permalink
Browse files
feature: added maxLength property
  • Loading branch information
hbarcelos committed Feb 5, 2020
1 parent ce31f3a commit c69968e00f0754bfb1ba3c657df3dba7211aadee
Showing with 16 additions and 0 deletions.
  1. +7 −0 round-linked-queue.js
  2. +9 −0 round-linked-queue.test.js
@@ -1,6 +1,13 @@
"use strict";

class RoundLinkedQueue {
constructor(maxLength) {
this._maxLength = maxLength;
}

get maxLength() {
return this._maxLength;
}
}

module.exports = RoundLinkedQueue;
@@ -4,4 +4,13 @@ const expect = chai.expect;
const RoundQueue = require("./round-linked-queue");

describe("Round-Queue", () => {
describe("When creating an instance", () => {
it("Should properly set the maxLength property", () => {
const queueLength = 3;

const queue = new RoundQueue(queueLength);

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

0 comments on commit c69968e

Please sign in to comment.