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.

29 wiersze
767 B

  1. import hundredTimes from './hundredTimes'
  2. it('should exist', () => {
  3. expect(hundredTimes).toBeDefined()
  4. })
  5. it('should be a callable', () => {
  6. expect(typeof hundredTimes).toBe('function')
  7. })
  8. it('should accept 1 argument', () => {
  9. expect(hundredTimes).toHaveLength(1)
  10. })
  11. test.each`
  12. value | display | name
  13. ${1} | ${'100'} | ${'einhundert'}
  14. ${2} | ${'200'} | ${'zweihundert'}
  15. ${3} | ${'300'} | ${'dreihundert'}
  16. ${4} | ${'400'} | ${'vierhundert'}
  17. ${5} | ${'500'} | ${'fünfhundert'}
  18. ${6} | ${'600'} | ${'sechshundert'}
  19. ${7} | ${'700'} | ${'siebenhundert'}
  20. ${8} | ${'800'} | ${'achthundert'}
  21. ${9} | ${'900'} | ${'neunhundert'}
  22. `('should return "$name" on $display', ({ value, name }) => {
  23. expect(hundredTimes(value)).toBe(name)
  24. })