/ src / common / utils / humanise.test.js
humanise.test.js
 1  import humanise from './humanise'
 2  
 3  describe('humanise', () => {
 4    test('it should transform a constant string for human reading', () => {
 5      const first = 'TEST'
 6      const second = 'ANOTHER_TEST'
 7  
 8      expect(humanise(first)).toEqual('Test')
 9      expect(humanise(second)).toEqual('Another Test')
10    })
11  
12    test('it should handle being passed a null', () => {
13      expect(humanise(null)).toEqual('')
14    })
15  
16    test('it should handle being passed undefined', () => {
17      expect(humanise()).toEqual('')
18    })
19  })