You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
385 B

4 years ago
  1. /**
  2. * Module dependencies.
  3. */
  4. var inherit = require('..');
  5. describe('inherit(a, b)', function(){
  6. it('should inherit b\'s prototype', function(){
  7. function Loki(){}
  8. function Animal(){}
  9. Animal.prototype.species = 'unknown';
  10. inherit(Loki, Animal);
  11. var loki = new Loki;
  12. loki.species.should.equal('unknown');
  13. loki.constructor.should.equal(Loki);
  14. })
  15. })