Today we covered an introduction to the basics of JavaScript. We talked about variables, and about primitive types (numbers, strings, booleans, and undefined). We talked about operators. We talked about control flow - code blocks, if and else, and for and while loops.
We've also spent some time talking about test-driven development, and the kinds of tools that let us make use of it.
This assignment will serve as an introduction to both.
After completing this assignment, you should...
- Understand the basics of JavaScript variables and primitive types
- Understand the basics of JavaScript operators and control flow
- Understand a very simple test-driven development workflow
After completing this assignment, you should be able to effectively use:
- Basic JavaScript
- Advanced TDD tools: Mocha and Chai
- node.js and Express, to start and run a web server
This assignment consists of a simple test runner that's performing a whole of tests on reasonably straightforward operations.
Replace the _BLANK_ variables with the appropriate values in public/index.js and public/test/test.index.js. So if a line consists of:
expect(2 + 2).to.equal(_BLANK_);You should replace it with:
expect(2 + 2).to.equal(4);All tests must be passing when you reload the page.
Write some of your own passing tests for each section.