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 line
680 B

  1. import tenTimes from './tenTimes'
  2. it('should exist', () => {
  3. expect(tenTimes).toBeDefined()
  4. })
  5. it('should be a callable', () => {
  6. expect(typeof tenTimes).toBe('function')
  7. })
  8. it('should accept 1 argument', () => {
  9. expect(tenTimes).toHaveLength(1)
  10. })
  11. test.each`
  12. value | display | name
  13. ${1} | ${'10'} | ${'ten'}
  14. ${2} | ${'20'} | ${'twenty'}
  15. ${3} | ${'30'} | ${'thirty'}
  16. ${4} | ${'40'} | ${'forty'}
  17. ${5} | ${'50'} | ${'fifty'}
  18. ${6} | ${'60'} | ${'sixty'}
  19. ${7} | ${'70'} | ${'seventy'}
  20. ${8} | ${'80'} | ${'eighty'}
  21. ${9} | ${'90'} | ${'ninety'}
  22. `('should return "$name" on $display', ({ value, name }) => {
  23. expect(tenTimes(value)).toBe(name)
  24. })