Get the name of a number, even if it's stupidly big.
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
To repozytorium jest zarchiwizowane. Możesz wyświetlać pliki i je sklonować, ale nie możesz do niego przepychać zmian lub otwierać zgłoszeń/Pull Requestów.

31 wiersze
822 B

  1. import getThousandName from './getThousandName'
  2. it('should exist', () => {
  3. expect(getThousandName).toBeDefined()
  4. })
  5. it('should be a callable', () => {
  6. expect(typeof getThousandName).toBe('function')
  7. })
  8. it('should accept 3 arguments', () => {
  9. expect(getThousandName).toHaveLength(3)
  10. })
  11. describe.each`
  12. hundreds | hundredsName
  13. ${1} | ${'one hundred'}
  14. ${2} | ${'two hundred'}
  15. ${3} | ${'three hundred'}
  16. ${4} | ${'four hundred'}
  17. ${5} | ${'five hundred'}
  18. ${6} | ${'six hundred'}
  19. ${7} | ${'seven hundred'}
  20. ${8} | ${'eight hundred'}
  21. ${9} | ${'nine hundred'}
  22. `('on $hundreds in hundreds place', ({ hundreds, hundredsName, }) => {
  23. it(`should return "${hundredsName}" on ${hundreds}00`, () => {
  24. expect(getThousandName(hundreds, 0, 0)).toBe(hundredsName)
  25. })
  26. })