Created
November 13, 2013 17:35
-
-
Save Madhuka/7453081 to your computer and use it in GitHub Desktop.
Node Test js file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Car(config) { | |
this.name = config.name; | |
this.engineSize = config.engineSize; | |
} | |
Car.prototype.getEngineSize = function() { | |
return this.engineSize; | |
}; | |
module.exports = Car; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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