Skip to content

Commit

Permalink
Reset Stack exercise files
Browse files Browse the repository at this point in the history
  • Loading branch information
bolitj01 committed Nov 15, 2023
1 parent d780fdd commit ceccfdd
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 34 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion exercises/tdd_stack/stack.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
* the LIFO (Last In, First Out) principle.
*/
class Stack {

}
28 changes: 28 additions & 0 deletions exercises/tdd_stack/test/ignore/stack_solution.test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Stack from "../stack.mjs"
import { expect } from "chai"

describe("Stack", function () {
//Satisfy these tests in order
it("is initially empty", function () {
const stack = new Stack();
expect(stack.top).to.equal(-1);
});

it("pushes to the top", function () {
const stack = new Stack();
stack.push(5);
expect(stack.top).to.equal(5);
stack.push("test");
expect(stack.top).to.equal("test");
});

it("pops from the top", function () {
const stack = new Stack();
stack.push(5);
stack.push("test");
let top = stack.pop();
expect(top).to.equal("test")
});


})
18 changes: 4 additions & 14 deletions exercises/tdd_stack/test/stack.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,17 @@ import Stack from "../stack.mjs"
import { expect } from "chai"

describe("Stack", function () {

//Satisfy these tests in order
it("is initially empty", function () {
const stack = new Stack();
expect(stack.top).to.equal(-1);

});

it("pushes to the top", function () {
const stack = new Stack();
stack.push(5);
expect(stack.top).to.equal(5);
stack.push("test");
expect(stack.top).to.equal("test");

});

it("pops from the top", function () {
const stack = new Stack();
stack.push(5);
stack.push("test");
let top = stack.pop();
expect(top).to.equal("test")

});


})
19 changes: 0 additions & 19 deletions exercises/tdd_stack/test/stack_solution.test.mjs

This file was deleted.

0 comments on commit ceccfdd

Please sign in to comment.