Get the name of a number, even if it's stupidly big.
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ce dépôt est archivé. Vous pouvez voir les fichiers et le cloner, mais vous ne pouvez pas pousser ni ouvrir de ticket/demande d'ajout.

31 lignes
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. })