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.

29 lines
709 B

  1. import hundreds from './hundreds'
  2. it('should exist', () => {
  3. expect(hundreds).toBeDefined()
  4. })
  5. it('should be a callable', () => {
  6. expect(typeof hundreds).toBe('function')
  7. })
  8. it('should accept 1 argument', () => {
  9. expect(hundreds).toHaveLength(1)
  10. })
  11. test.each`
  12. value | display | name
  13. ${1} | ${'100'} | ${'sen'}
  14. ${2} | ${'200'} | ${'duwosen'}
  15. ${3} | ${'300'} | ${'tresen'}
  16. ${4} | ${'400'} | ${'kuwadringhen'}
  17. ${5} | ${'500'} | ${'kuwinghen'}
  18. ${6} | ${'600'} | ${'sesen'}
  19. ${7} | ${'700'} | ${'septinghen'}
  20. ${8} | ${'800'} | ${'oktinghen'}
  21. ${9} | ${'900'} | ${'nonghen'}
  22. `('should return "$name" on $display', ({ value, name }) => {
  23. expect(hundreds(value)).toBe(name)
  24. })