Get the name of a number, even if it's stupidly big.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Tento repozitář je archivovaný. Můžete prohlížet soubory, klonovat, ale nemůžete nahrávat a vytvářet nové úkoly a požadavky na natažení.

tenPlus.test.ts 721 B

1234567891011121314151617181920212223242526272829
  1. import tenPlus from './tenPlus'
  2. it('should exist', () => {
  3. expect(tenPlus).toBeDefined()
  4. })
  5. it('should be a callable', () => {
  6. expect(typeof tenPlus).toBe('function')
  7. })
  8. it('should accept 1 argument', () => {
  9. expect(tenPlus).toHaveLength(1)
  10. })
  11. test.each`
  12. value | display | name
  13. ${0} | ${'10'} | ${'zehn'}
  14. ${1} | ${'11'} | ${'elf'}
  15. ${2} | ${'12'} | ${'zwölf'}
  16. ${3} | ${'13'} | ${'dreizehn'}
  17. ${4} | ${'14'} | ${'vierzehn'}
  18. ${5} | ${'15'} | ${'fünfzehn'}
  19. ${6} | ${'16'} | ${'sechzehn'}
  20. ${7} | ${'17'} | ${'siebzehn'}
  21. ${8} | ${'18'} | ${'achtzehn'}
  22. ${9} | ${'19'} | ${'neunzehn'}
  23. `('should return "$name" on $display', ({ value, name }) => {
  24. expect(tenPlus(value)).toBe(name)
  25. })