initial commit
This commit is contained in:
22
node_modules/newify/test/test.js
generated
vendored
Normal file
22
node_modules/newify/test/test.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
describe('newify', function(){
|
||||
|
||||
var newify = require('../index')
|
||||
|
||||
function Student(firstName, lastName, birthYear){
|
||||
this.firstName = firstName
|
||||
this.lastName = lastName
|
||||
this.birthYear = birthYear
|
||||
}
|
||||
|
||||
it('should work as expected', function(){
|
||||
|
||||
var s = newify(Student, ['john','scot', 1980])
|
||||
|
||||
;(s instanceof Student).should.equal(true)
|
||||
s.firstName.should.equal('john')
|
||||
s.lastName.should.equal('scot')
|
||||
s.birthYear.should.equal(1980)
|
||||
|
||||
})
|
||||
|
||||
})
|
||||
Reference in New Issue
Block a user