Get the name of a number, even if it's stupidly big.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Repozitorijs ir arhivēts. Tam var aplūkot failus un to var klonēt, bet nevar iesūtīt jaunas izmaiņas, kā arī atvērt jaunas problēmas/izmaiņu pieprasījumus.

29 rindas
675 B

  1. import tens from './tens'
  2. it('should exist', () => {
  3. expect(tens).toBeDefined()
  4. })
  5. it('should be a callable', () => {
  6. expect(typeof tens).toBe('function')
  7. })
  8. it('should accept 1 argument', () => {
  9. expect(tens).toHaveLength(1)
  10. })
  11. test.each`
  12. value | display | name
  13. ${1} | ${'10'} | ${'des'}
  14. ${2} | ${'20'} | ${'bihin'}
  15. ${3} | ${'30'} | ${'trihin'}
  16. ${4} | ${'40'} | ${'kuwadrahin'}
  17. ${5} | ${'50'} | ${'kuwinkuwahin'}
  18. ${6} | ${'60'} | ${'seksahin'}
  19. ${7} | ${'70'} | ${'septuwahin'}
  20. ${8} | ${'80'} | ${'oktohin'}
  21. ${9} | ${'90'} | ${'nonahin'}
  22. `('should return "$name" on $display', ({ value, name }) => {
  23. expect(tens(value)).toBe(name)
  24. })