Jasmine is a behavior-driven development framework for testing JavaScript code. It does not rely on browsers, DOM, or any JavaScript framework. It has a clean, obvious syntax to be able to write tests easily.
I want to define a convert function
“function convert(number, baseUnit)” which will take a number and a baseUnit as an input,
for example convert(1, ‘Kilometer’) and return back a hash of all converted units
example return: {‘Kilometer’: 1, ‘Meter’: 1000, … }
So in a true TDD (Test Driven Development) style I am going to write my tests first and then write code to make them pass. For this example I am actually going to create a video, which should show you how to get started with Jasmine on your machine and write specs..
Your new post is loading...