Skip to content

Instantly share code, notes, and snippets.

@Madhuka
Created November 14, 2013 19:10
Show Gist options
  • Save Madhuka/7472558 to your computer and use it in GitHub Desktop.
Save Madhuka/7472558 to your computer and use it in GitHub Desktop.
jasmine testing one (Car sample)
function Car(config) {
this.name = config.name;
this.engineSize = config.engineSize;
}
Car.prototype.getEngineSize = function() {
return this.engineSize;
};
describe("Car ", function() {
var myCar = new Car({
name : "Vitz",
engineSize : 1000
});
it("Car will have name and engineSize", function() {
expect(myCar.name).toBe('Vitz');
expect(myCar.engineSize).toBe(1000);
});
it("Car will give it engineSize", function() {
expect(myCar.getEngineSize()).toBe(1000);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment