SHARE
TWEET

Untitled

a guest May 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. describe('Person', function(){
  2.     var person = require('../src/person');
  3.  
  4.     beforeEach(function(){
  5.         jasmine.addMatchers(personCustomValidators);
  6.     })
  7.  
  8.     it('Should match first name', function(){
  9.         person.setName("first last");
  10.  
  11.         var result = person.getName();
  12.  
  13.         expect(result).toBeFirstNameEqualTo("first");
  14.     })
  15.  
  16.     it('Should match last name', function(){
  17.         person.setName("first last");
  18.  
  19.         var result = person.getName();
  20.  
  21.         expect(result).toBeLastNameEqualTo("last");
  22.     })
  23.  
  24.     it('Should match age', function(){
  25.         person.setAge(106);
  26.  
  27.         var result = person.getAge();
  28.  
  29.         expect(result).toBe(106);
  30.     })
  31.  
  32.     it('should older than 100', function() {
  33.         person.setAge(106);
  34.  
  35.         var result = person.getAge();
  36.  
  37.         expect(result).toBeOlderThan(100);
  38.     })
  39. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top