Skip to content

Commit

Permalink
Stack tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesseanwright committed Aug 28, 2017
1 parent e3e11be commit bcf1efa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/mazeGenerator/stackTests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'use strict';

const createStack = require('./stack');

describe('the stack', function () {
it('should maintain LIFO ordering via the push and pop methods', function () {
const stack = createStack();
const items = [1, 4, 2, 7];

items.forEach(stack.push);

items.reverse().forEach(
expectedItem => expect(stack.pop()).to.equal(expectedItem)
);
});
});

0 comments on commit bcf1efa

Please sign in to comment.