Skip to content

Instantly share code, notes, and snippets.

@Madhuka
Created November 13, 2013 17:35
Show Gist options
  • Save Madhuka/7453081 to your computer and use it in GitHub Desktop.
Save Madhuka/7453081 to your computer and use it in GitHub Desktop.
Node Test js file
function Car(config) {
this.name = config.name;
this.engineSize = config.engineSize;
}
Car.prototype.getEngineSize = function() {
return this.engineSize;
};
module.exports = Car;
var should = require('should');
var car = require("./car.js");
var assert = require("assert")
var mycar = new car({
name : "Vitz",
engineSize : 1000
});
describe('#Car()', function() {
it('Car enginesize method test', function() {
mycar.getEngineSize().should.equal(1000);
})
})
describe('#Car()', function() {
it('Car name test', function() {
mycar.name.should.equal('Vitz');
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment