diff --git a/linked_lists/javascript/ListNode.js b/linked_lists/javascript/ListNode.js new file mode 100644 index 0000000..e69de29 diff --git a/linked_lists/javascript/ListNode_test.js b/linked_lists/javascript/ListNode_test.js new file mode 100644 index 0000000..19aa74b --- /dev/null +++ b/linked_lists/javascript/ListNode_test.js @@ -0,0 +1,32 @@ +describe('ListNode', function() { + it('should have a data property', function(){ + var node = new ListNode(); + expect(node).to.have.property('data'); + }); + + // it('should have data', function() { + // var node = new ListNode('info'); + // expect(node.data).to.eq('info'); + // var pizzaNode = new ListNode('pizza'); + // expect(pizzaNode.data).to.eq('pizza'); + // }); + + // it('should have a default empty nextNode', function() { + // var node = new ListNode('pizza'); + // expect(node.nextNode).to.eq(null); + // }); + + // it('should allow setting a nextNode', function() { + // var n1 = new ListNode('pizza'); + // var n2 = new ListNode('cats'); + // n1.nextNode = n2; + // expect(n1.nextNode.data).to.eq('cats'); + // expect(n1.nextNode instanceof ListNode).to.be.true; + // }); + + // it('should allow a next node argument on creation', function(){ + // var node = new ListNode('pizza', new ListNode('cats')); + // expect(node.nextNode.data).to.eq('cats'); + // expect(node.nextNode instanceof ListNode).to.be.true; + // }); +}); diff --git a/linked_lists/javascript/README.md b/linked_lists/javascript/README.md index b698b0e..de3b1e8 100644 --- a/linked_lists/javascript/README.md +++ b/linked_lists/javascript/README.md @@ -1,7 +1,9 @@ # Linked List Problem -## Running the Tests +Open the `test.html` page to see your tests run in the brower. -You can run the tests in this folder in the browser. +There are two sets of tests to get passing! -To run in the browser, open the `index.html` page and you should see your tests. +Start with the tests in `ListNode_test.js` + +Once those are passing, more on to the tests in `LinkedList_test.js` \ No newline at end of file diff --git a/linked_lists/javascript/linkedList_test.js b/linked_lists/javascript/linkedList_test.js index 736a1cf..c88fdfb 100644 --- a/linked_lists/javascript/linkedList_test.js +++ b/linked_lists/javascript/linkedList_test.js @@ -1,29 +1,3 @@ -describe('ListNode', function() { - it('should have data', function() { - var node = new ListNode('pizza'); - expect(node.data).to.eq('pizza'); - }); - - it.skip('should have a default empty nextNode', function() { - var node = new ListNode('pizza'); - expect(node.nextNode).to.eq(null); - }); - - it.skip('should allow setting a nextNode', function() { - var n1 = new ListNode('pizza'); - var n2 = new ListNode('cats'); - n1.nextNode = n2; - expect(n1.nextNode.data).to.eq('cats'); - expect(n1.nextNode instanceof ListNode).to.be.true; - }); - - it.skip('should allow a next node argument on creation', function(){ - var node = new ListNode('pizza', new ListNode('cats')); - expect(node.nextNode.data).to.eq('cats'); - expect(node.nextNode instanceof ListNode).to.be.true; - }); -}); - describe('LinkedList', function() { var list; diff --git a/linked_lists/javascript/index.html b/linked_lists/javascript/test.html similarity index 73% rename from linked_lists/javascript/index.html rename to linked_lists/javascript/test.html index 42db353..6c4f29a 100644 --- a/linked_lists/javascript/index.html +++ b/linked_lists/javascript/test.html @@ -14,10 +14,12 @@ + + + - - - + +