Guest User

Untitled

a guest
Jan 18th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. var Bob = function (input) {
  2. this.input = input;
  3. }
  4.  
  5. Bob.prototype.hey = function () {
  6. console.log(this.input);
  7.  
  8. var whatever = this.input[this.input.length - 1];
  9.  
  10. console.log(whatever);
  11.  
  12. if (whatever === '.' || /[a - z]/.test(whatever)) {
  13. return 'Whatever.';
  14. }
  15. }
  16.  
  17. module.exports = Bob;
  18.  
  19. var Bob = require('./bob.js');
  20.  
  21. describe('Bob', function () {
  22. var bob = new Bob();
  23.  
  24. it('stating something', function () {
  25. var result = bob.hey('Tom-ay-to, tom-aaaah-to.');
  26. expect(result).toEqual('Whatever.');
  27. });
Add Comment
Please, Sign In to add comment