Get the name of a number, even if it's stupidly big.
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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

30 lines
673 B

  1. import ones from './ones'
  2. it('should exist', () => {
  3. expect(ones).toBeDefined()
  4. })
  5. it('should be a callable', () => {
  6. expect(typeof ones).toBe('function')
  7. })
  8. it('should accept 1 argument', () => {
  9. expect(ones).toHaveLength(1)
  10. })
  11. test.each`
  12. value | display | name
  13. ${0} | ${'0'} | ${'zero'}
  14. ${1} | ${'1'} | ${'one'}
  15. ${2} | ${'2'} | ${'two'}
  16. ${3} | ${'3'} | ${'three'}
  17. ${4} | ${'4'} | ${'four'}
  18. ${5} | ${'5'} | ${'five'}
  19. ${6} | ${'6'} | ${'six'}
  20. ${7} | ${'7'} | ${'seven'}
  21. ${8} | ${'8'} | ${'eight'}
  22. ${9} | ${'9'} | ${'nine'}
  23. `('should return "$name" on $display', ({ value, name }) => {
  24. expect(ones(value)).toBe(name)
  25. })