Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. describe('test', function() {
  2. function CreateApple(type,color, width){
  3. this.type= type
  4. this.color=color;
  5. this.width=width;
  6. }
  7.  
  8. CreateApple.prototype.eat= function(){
  9. return console.log("eat mniam, mniam");
  10. }
  11.  
  12. CreateApple.prototype.height = 55;
  13.  
  14. CreateApple.prototype.xxx={
  15. module1: 1,
  16. hhh: 2,
  17.  
  18. tablice:{
  19. tab1: function(num){return num},
  20. tab2: 44,
  21. }
  22. }
  23.  
  24. it('test1', function() {
  25.  
  26.  
  27. var apple1 = new CreateApple("goodone", "red", 34);
  28. apple1.eat();
  29. console.log(apple1.type);
  30. console.log(apple1.height);
  31. var ttt= apple1.xxx.hhh;
  32. var uuu= apple1.xxx.tablice.tab1(4);
  33. console.log(ttt+" "+uuu);
  34.  
  35. });
  36. });
  37.  
  38. require('../jgh/page4.js');
  39.  
  40. describe('test', function() {
  41.  
  42. it('test1', function() {
  43.  
  44. var apple1 = new CreateApple("goodone", "red", 34);
  45. apple1.eat();
  46. console.log(apple1.type);
  47. console.log(apple1.height);
  48. var ttt= apple1.xxx.hhh;
  49. var uuu= apple1.xxx.tablice.tab1(4);
  50. console.log(ttt+" "+uuu);
  51.  
  52. });
  53. });
  54.  
  55. modules.exports =function CreateApple(type,color, width){
  56. this.type= type
  57. this.color=color;
  58. this.width=width;
  59. }
  60.  
  61. CreateApple.prototype.eat= function(){
  62. return console.log("eat mniam, mniam");
  63. }
  64.  
  65. CreateApple.prototype.height = 55;
  66.  
  67. CreateApple.prototype.xxx={
  68. module1: 1,
  69. hhh: 2,
  70.  
  71. tablice:{
  72. tab1: function(num){return num},
  73. tab2: 44,
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement